is there a tool which will automatically detect improper structure alignments.
-
Hello group. i have a very large c program with several hundreds of structures. is there is a tool which could detect bad structure padding. Thanks & Regards Prasun
-
Hello group. i have a very large c program with several hundreds of structures. is there is a tool which could detect bad structure padding. Thanks & Regards Prasun
Member 4686590 wrote:
Hello group.
i have a very large c program with several hundreds of structures. is there is a tool which could detect bad structure padding.
Thanks & Regards
PrasunI think No. Which editor are you using to code your C program? I'm using Visual Studio 2008 IDE. In that I've to select the block I want to format(by pressing SHIFT+ARROWKEY or using mouse),and then press CTRL+F to format.
-
Member 4686590 wrote:
Hello group.
i have a very large c program with several hundreds of structures. is there is a tool which could detect bad structure padding.
Thanks & Regards
PrasunI think No. Which editor are you using to code your C program? I'm using Visual Studio 2008 IDE. In that I've to select the block I want to format(by pressing SHIFT+ARROWKEY or using mouse),and then press CTRL+F to format.
He was not talking about indentation, but about this[^]
Cédric Moonen Software developer
Charting control [v3.0] OpenGL game tutorial in C++ -
Hello group. i have a very large c program with several hundreds of structures. is there is a tool which could detect bad structure padding. Thanks & Regards Prasun
I don't know, but Lint[^] comes to mind when dealing with static code analyses. Don't know if it can handle inefficient member alignment though. There is also a code analyzer in VS2010 if you have Ultimate edition. You might end up in trouble trying to optimize for space like this, if the order of the members is used in any way in the program. Some C (and C++) programmers tend to take shortcuts once in awhile. Just a word of warning.
-
Hello group. i have a very large c program with several hundreds of structures. is there is a tool which could detect bad structure padding. Thanks & Regards Prasun
Usually you can tell that something is not configured to pack correctly using
#pragma pack(show)
calls in suspect areas. http://msdn.microsoft.com/en-us/library/2e70t5y1%28v=VS.100%29.aspx[^] -
Hello group. i have a very large c program with several hundreds of structures. is there is a tool which could detect bad structure padding. Thanks & Regards Prasun