Hacker News new | ask | show | jobs
by lzybkr 4136 days ago
I take it back, the VC++ options are C++ only (faulty memory, it's been too long.)

There is a warning I added which does work in C (https://msdn.microsoft.com/en-us/library/t7khkyth.aspx). As I recall, this warning is sometimes useless (unless it's been improved upon), so it's best to turn it on only when you're investigating packing.

You make a good point about C code not compiling as C++ as much as it used to, but that's probably less true for VC code.

And I should point out - often, for the purposes of tuning, you can extract just what you need from some code, get that small chunk of code compiling as C++, and leverage your compiler's dumps.

Last thing - debuggers also know the layout of your objects. windbg's 'dt' command can show you the object layout - I'm sure other debuggers have a similar command.