Strange behavior of gcc-3.1
Claudio Bley
bley@cs.uni-magdeburg.de
Tue Jul 23 04:17:00 GMT 2002
>>>>> "Agust" == Agust Karlsson <Gusti@pallas.dk> writes:
Agust> I have just upgraded my gcc from 2.96 (RedHat 7.2
Agust> distribution) to 3.1 (compiled from source with
Agust> prefix=/usr) Oddly, things that did work OK before seem to
Agust> fail now.
Agust> I have included an example with the error messages I get.
Agust> Does someone have a clou on what's happened???
Agust> ---------- struct Data { int var[10]; };
You declared a type, but no instance of it.
struct Data { int var[10}; } Data;
Agust> void f1( int *param) { int p; p = param[ 7]; if (( 7<=p) &&
Agust> (p<= 14)) Data.var[ 7] = p; // p = param[ 9]; // any of
Agust> these two lines // if (( 5<=p) && (p<= 30)) // can provoke
Agust> the error in the next line Data.var[ 9] = p; }
Agust> // ---------------------------
Agust> // how to declare and use a packed enum ?
Agust> typedef enum { v11=1, v12=2 } e1 __attribute__ ((packed));
typedef enum e1 { v11=1, v12=2 } e1 __attribute__ ((packed));
Agust> void g1( e1 par) {}
enum e2 { v21=1, v22=2} __attribute__ ((packed));
It seems this doesn't work. You may want to file a bug report.
Claudio
More information about the Gcc-help
mailing list