This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc pragma pack on hpux
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: efrias at syncad dot com (Eric Frias)
- Cc: dave dot anglin at nrc-cnrc dot gc dot ca, gcc at gcc dot gnu dot org
- Date: Thu, 16 Dec 2004 17:00:46 -0500 (EST)
- Subject: Re: gcc pragma pack on hpux
> I have a question about the HP-UX port of gcc, and from looking at the
> gcc Contributors list it looks like you're the person to ask. I'm
> working on porting some software (winelib) that makes heavy use of
> #pragma pack, and gcc doesn't support this pragma on HP-UX. I was
> hoping you could tell me why it is disabled.
>
> I tried adding the HANDLE_PRAGMA_PACK define to gcc's config files and
> it looks like #pragma pack started working correctly (I haven't run the
> regression tests yet to confirm it).
I don't know. It hasn't come up in the period that I have been
involved in GCC.
> If necessary, I think I can use __attribute__((packed,aligned(x))) to
> work around this, but it needs to be applied on a structure-by-structure
> basis. The software I'm porting has about 10k lines surrounded by
> pragma pack directives, so converting it to use attributes would be very
> tedious.
>
> Do you know if turning on these options will break anything? Is there
> any chance future releases of gcc will have this enabled by default?
The maximum alignment available for bss/common variables is 8 bytes
with the 32-bit SOM linker. That's the only restriction that I'm
aware of, Thus, it may be ok to define HANDLE_PRAGMA_PACK_PUSH_POP
in the file hpux.h.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)