X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f From: RazorSliph Newsgroups: comp.os.msdos.djgpp Subject: Re: -fpack-struct issues Message-ID: <7suq4uolul64t1n2ut2pd3po2d1l3sd052@4ax.com> References: <6kvo4ukaf4ceud3gn6pp0ut7t08jsup0kv AT 4ax DOT com> <3405-Tue22Jan2002091904+0200-eliz AT is DOT elta DOT co DOT il> X-Newsreader: Forte Agent 1.8/32.553 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 33 Date: Tue, 22 Jan 2002 09:48:35 -0500 NNTP-Posting-Host: 24.200.83.135 X-Complaints-To: abuse AT videotron DOT ca X-Trace: wagner.videotron.net 1011710877 24.200.83.135 (Tue, 22 Jan 2002 09:47:57 EST) NNTP-Posting-Date: Tue, 22 Jan 2002 09:47:57 EST To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Tue, 22 Jan 2002 09:19:05 +0200, "Eli Zaretskii" wrote: >> From: RazorSliph >> Newsgroups: comp.os.msdos.djgpp >> Date: Mon, 21 Jan 2002 15:57:26 -0500 >> >> Greetings! I need to compile an application using the -fpack-struct so >> that the structures generated (and written to disk) are identical to >> the saved structures created by another program. The structures, >> unfortunately, are 10 bytes wide, and get padded to 12 bytes with a >> base compile. > >See section 22.11 of the DJGPP FAQ list, it explains the issues >involved and suggests several possible solutions. > >> However, whenever I compile with the -fpack-struct option, the >> resulting executable segfaults. (GPF's) > >That's expected, since you include headers which define structures >used by C++ library functions, and those library functions were not >compiled with -fpack-struct. So you introduced an incompatibility >between the library and your program. This is also exlpained in the >FAQ. > >In general, I find -fpack-struct to have too many limitations to be >of practical use for what you want to do. Use one of the other >methods described in the FAQ. Thanks! Heh - I can't believe that I didn't RTFM...