This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

-fpack-struct creates segfaulting code


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
/(   )\                       
 ^^-^^                        


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]