M
Martin Vorbrodt
here's what i have:
struct SCSI_CDB {
....
union {
struct {
unsigned char address0;
unsigned char address1;
unsigned char address2;
};
unsigned char address[3];
};
....
};
then i do:
SCSI_CDB cdb;
cdb.address0 = 0xFF;
MSVC++7 compiles it. GCC with -ansi flag says it's forbiden to have struct
without a name.
should i do this:
struct {
unsigned char address0;
...
} adr;
and then:
cdb.adr.address0 = 0xFF;
is it legal according to the standard to ommit the adr?
struct SCSI_CDB {
....
union {
struct {
unsigned char address0;
unsigned char address1;
unsigned char address2;
};
unsigned char address[3];
};
....
};
then i do:
SCSI_CDB cdb;
cdb.address0 = 0xFF;
MSVC++7 compiles it. GCC with -ansi flag says it's forbiden to have struct
without a name.
should i do this:
struct {
unsigned char address0;
...
} adr;
and then:
cdb.adr.address0 = 0xFF;
is it legal according to the standard to ommit the adr?