This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
-fpack-struct creates segfaulting code
- From: Panagiotis Issaris <takis at lumumba dot luc dot ac dot be>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 9 Apr 2002 15:51:28 +0200
- Subject: -fpack-struct creates segfaulting code
- Reply-to: takis at lumumba dot luc dot ac dot be
Hi,
When compiling C++ source code using the -fpack-struct flag
the generated executable immediately segfaults when run.
Here's the source code:
#include<iostream>
struct MyStruct
{
char a;
short b;
int c;
};
int main()
{
using namespace std;
cout << "Size of struct: " << sizeof(MyStruct) << endl;
}
Compiled with: g++-3.0 pack.cc -fpack-struct
When I compile exactly the same source file with GCC 2.95.4 there's no
problem at all. When compiling the equivalent C code using both
2.95.4 and 3.0.3 there's also no problem at all.
I'm using GCC 3.0.3 on Debian Sid.
Linux ares 2.4.17-xfs #5 Sat Mar 16 20:42:21 CET 2002 i586 unknown
With friendly regards,
Takis
--
.-. | lumumba.luc.ac.be/takis/takis_key.txt
/v\ L I N U X | panagiotis.issaris@mech.kuleuven.ac.be
// \\ >Phear the Penguin< | ICQ: 12764288
/( )\
^^-^^