Article View: gnu.g++.bug
Article #178pragma pack(1) broken g++ v2.2.2
From: Rick Kitts
Date: Thu, 06 Aug 1992 02:09
Date: Thu, 06 Aug 1992 02:09
26 lines
946 bytes
946 bytes
g++ v2.2.2 configured for i486v4:
It appears that pragma pack(?) is broken. I've attached a small program
which demonstrates the problem. First give it the extension of .cc,
compile and run it. Now rename it with an extension of .c and recompile
and run. 2 different sizes. Oops.
------- cut here ------
#include <stdio.h>
#pragma pack(1)
typedef struct{
long a;
short b;
long c;
char d[255];
} aFoo;
main()
{
printf("sizeof(aFoo) = %d\n", sizeof(aFoo));
}
---Rick
Technical Details
Message-ID:
<++xmw3a.rkitts@netcom.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!usc!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!netcom.com!rkittsShow Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug Path: arc1-ca.pugleaf.net!sparky!uunet!usc!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!netcom.com!rkitts From: rkitts@netcom.com (Rick Kitts) Subject: pragma pack(1) broken g++ v2.2.2 Message-ID: <++xmw3a.rkitts@netcom.com> Sender: gnulists@ai.mit.edu Organization: Netcom - Online Communication Services (408 241-9760 guest) Distribution: gnu Date: Thu, 6 Aug 1992 02:09:34 GMT Approved: bug-g++@prep.ai.mit.edu Lines: 27