This is the mail archive of the gcc-help@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]

Re: Strange behavior of gcc-3.1


>>>>> "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


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