This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Question about "#pragma pack(n)"


On Tue, 2005-04-05 at 21:20, feng qiu wrote:
> In c-pragma.c file, #pragma pack(n) set the value of 
> "maximum_field_alignment".
> And in opts.c file,-fpack-struct set "flag_pack_struct = 1" .
> But I don't known the relation between them.

Try using grep, as in "grep flag_pack_struct *.c" and "grep
maximum_field_alignment *.c".

> It seems that they relate to the four ariablesââ
> DECL_ALIGN,DECL_PACKED,TYPE_PACKED,and TYPE_ALIGN in stor-layout.c file,but 
> what is the difference in them?Should I modify this file?

If you really want to modify files, and submit a patch, you have to use
current mainline sources.  This stuff works differently on mainline than
it does in the older sources you are looking at.  We can't accept a
patch based off of an older release.

Yes, you are looking in the right place.  TYPE_PACKED and
maximum_field_alignment are the important ones for this particular
problem.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]