This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: Problem declaring struct and union
- From: <john dot gill at quadrics dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Tue, 29 Nov 2005 15:28:45 -0000
- Subject: RE: Problem declaring struct and union
What is a VUINT32?
If you add:
typedef volatile unsigned long VUINT32;
before the struct definition
I find it compiles... Of course VUINT32 may not be
a volatile unsigned long, and an unsigned long may not
be 32 bits wide on your machine. You would have to check this.
I think it is okay to have unnamed fields as this provides
for padding.
Cheers
John
-----Original Message-----
From: Steffen Damelang [mailto:steffen.damelang@web.de]
Sent: 29 November 2005 11:44
To: gcc-help@gcc.gnu.org
Subject: Problem declaring struct and union
Hi together,
my name is steffen and I use the gcc 3.4.4.
I have got the following code and I don`t understand why it will not be complied.
struct INTC_tag {
union {
VUINT32 R;
struct {
VUINT32:26;
VUINT32 VTES:1;
VUINT32:4;
VUINT32 HVEN:1;
} B;
} MCR;
};
The error is:
warning: no semicolon at end of struct or union
error: parse error before numeric constant
Can anyone help me please ?!
Thanks
Steffen
______________________________________________________________________
XXL-Speicher, PC-Virenschutz, Spartarife & mehr: Nur im WEB.DE Club!
Jetzt gratis testen! http://freemail.web.de/home/landingpad/?mc=021130