Q
QbProg
Hello,
what I'm saying here is about VS 2005 WITHOUT service pack.
I have two DLL projects, with EXACTLY the same project preferences and
settings. Both have alignment set to "default", it should be 8.
Surpise number one:
In project B I include a file of project A in this way
#include <FILE_FROM_A.h>
it generates classes inside the include with an alignment of "1", but
only in project B . I've checked everything, I don't change it with
#pragma pack anywhere.
The code (in project B)
#pragma pack(show)
#include <FILE_FROM_A.h>
displays a warning similar to "Pragma pack = 1"
even if I set it to 8 explicitly from the project settings.
Surprise number two:
#pragma pack(8)
#include <FILE_FROM_A.h>
if I insert into FILE_FROM_A.h the line
#pragma pack(show)
When I compile project A it shows me 8. Else it shows me 1 anyway !!!
Surprise number three:
When I finally get it to work by explicitly setting packing into each
file with #pragma pack, it works (the classes have the same aligment),
but the class is 4 bytes larger in project A that in project B. I
repeat: SAME preprocessor definitions, SAME project settings.
I spent one hour realizing that was an aligment problem
Someone had similar issues?
QbProg
what I'm saying here is about VS 2005 WITHOUT service pack.
I have two DLL projects, with EXACTLY the same project preferences and
settings. Both have alignment set to "default", it should be 8.
Surpise number one:
In project B I include a file of project A in this way
#include <FILE_FROM_A.h>
it generates classes inside the include with an alignment of "1", but
only in project B . I've checked everything, I don't change it with
#pragma pack anywhere.
The code (in project B)
#pragma pack(show)
#include <FILE_FROM_A.h>
displays a warning similar to "Pragma pack = 1"
even if I set it to 8 explicitly from the project settings.
Surprise number two:
#pragma pack(8)
#include <FILE_FROM_A.h>
if I insert into FILE_FROM_A.h the line
#pragma pack(show)
When I compile project A it shows me 8. Else it shows me 1 anyway !!!
Surprise number three:
When I finally get it to work by explicitly setting packing into each
file with #pragma pack, it works (the classes have the same aligment),
but the class is 4 bytes larger in project A that in project B. I
repeat: SAME preprocessor definitions, SAME project settings.
I spent one hour realizing that was an aligment problem
Someone had similar issues?
QbProg