Hacker News new | past | comments | ask | show | jobs | submit login

I implemented the VC++ options - they work in C.

I have no experience with the others, I've just briefly read about them and assume they are similar. If they don't work in C and you would find the dumps useful, try compiling as C++.




VC++ is fundamentally a C++ compiler that has spotty support for C features introduced after ISO C90. GCC and clang are probably better.

That said, many non-trivial C codebases cannot simply be compiled with a C++ compiler.


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.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: