Subject: I found another compiler bug!
From: [email-masked] (Jonathan Lanier)

7 May 1997 22:35:58 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <Pine.SOL.3.91.970507151001.29829A.cygnus.gnu-win32@westmain>
Mime-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-851401618-863043406=:29829"
Original-To: Win32 Mailing List <[email-masked]>
Original-cc: [email-masked]
Original-Sender: [email-masked]

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to [email-masked] for more info.

---559023410-851401618-863043406=:29829
Content-Type: TEXT/PLAIN; charset=US-ASCII

Attached is an example of a serious bug in the GCC compiler.  The gist of 
it is, if you use packed structures in GCC, and then attempt to use 
bitfields in those packed structures, the compiler completely 
miscalculates the offsets for the data in the structure.

This example demonstrates a C++ class containing only 2 members.  Each 
one is initialized separately, and the resulting answers printed for each 
member should be different, but they are not.  Removing the 
__attribute__((packed)) keyword gets rid of the error, but it means you 
can't pack your structures, which in my case is something I really need 
to do!

Does anyone know if this bug was previously known, or if it exists on 
other architectures?

- Jonathan
  [email-masked]

---559023410-851401618-863043406=:29829
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="bits.cpp"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.SOL.3.91.970507151646.29829B@westmain>
Content-Description: 

---559023410-851401618-863043406=:29829--
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".