Subject: Re: one point (Was [Re: FW: Re: wxwin port])
From: [email-masked] (Scott Christley)

19 Nov 1996 16:00:16 -0800
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Sender: [email-masked]
X-Mailer: Windows Eudora Light Version 1.5.2
Original-To: Doug Evans <[email-masked]>
Original-Cc: [email-masked], [email-masked]
Original-Sender: [email-masked]

At 05:08 PM 11/18/96 -0800, Doug Evans wrote:
>
>I don't believe this assessment can be correct.
>If GCC doesn't align structures [by default] the way the native compiler does,
>then that is a bug, end of story.
>

It appears that the Microsoft header file is forcing the packing of the
structure.  Before it defines the structure it includes in a file called
"pshpack2.h" which I've included below:

/*++

Copyright (c) 1995-1996  Microsoft Corporation

Module Name:

    pshpack2.h

Abstract:

    This file turns 2 byte packing of structures on.  (That is, it disables
    automatic alignment of structure fields.)  An include file is needed
    because various compilers do this in different ways.  For Microsoft
    compatible compilers, this files uses the push option to the pack pragma
    so that the poppack.h include file can restore the previous packing
    reliably.

    The file poppack.h is the complement to this file.

--*/

#if ! (defined(lint) || defined(_lint) || defined(RC_INVOKED))
#if ( _MSC_VER >= 800 ) || defined(_PUSHPOP_SUPPORTED)
#pragma warning(disable:4103)
#if !(defined( MIDL_PASS )) || defined( __midl )
#pragma pack(push)
#endif
#pragma pack(2)
#else
#pragma pack(2)
#endif
#endif // ! (defined(lint) || defined(_lint) || defined(RC_INVOKED))

******

So my question at this point is does GCC support this pushing of pack, or am
I correct in using __attribute__ ((packed)) where appropriate?

So to adjust my assessment, GCC is aligning structures the same way as the
native compiler; the packing behaviour was changed for that structure within
the include files.

Scott

-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".