Subject: Re: mklocale, take 2
To: Todd Vierling <>
From: James Chacon <>
List: tech-toolchain
Date: 10/18/2001 22:57:16
How again you're relying on a specific compilers implementation to potentially
guide you for all implementations.

I'd say leave it as an __attribute__ and wrap the compat version of sys/cdef.h
with some checks for GCC and other compilers. If it falls all the way through
just #error out and make the person trying a non-native build either use gcc
or add the definition for their hosts compiler.


>On Thu, 18 Oct 2001, Jason R Thorpe wrote:
>:  > Yes, and that's the point.  If the compiler doesn't support packed structs,
>:  > the code should be uncompilable on that compiler.  (Otherwise you'll end up
>:  > with nondescript errors and crashes thanks to the improper alignment of
>:  > data in the struct.)
>: #pragma packed
>: /* a structure you want packed */
>:, what pragma do I use for:
>: /* another strucutre, that I don't want packed */
>You wrap the structure on both sides, as in:
>#pragma pack(1)
>struct packedstruct {
>#pragma pack
>The second, without argument, resets packing to the compiler's ABI default.
>-- Todd Vierling <>  *  Wasabi NetBSD:  Run with it.
>-- CDs, Integration, Embedding, Support --