A
Andreas Eibach
Hi there,
got some tricky problem here:
(at least if I want to write good ISO C code)
typedef struct {
union
{
USHORT byte [512];
ULONG lword[512/4];
};
} raw_s;
Of course, when the compiler is set to accept ISO code only. this will
output the warning:
"unnamed structures/unions are not allowed in ISO C".
So I tried to do
typedef struct {
union
{
USHORT byte [512];
ULONG lword[512/4];
} raw_u;
} raw_s;
Now one of my core functions complains that raw_s has no member named 'byte'
(nor lword)
How can I solve this and still comply to the ISO C standard?
Curiously, if I ignore the warning of the first solution, it works a treat
anyway (well, not ISO tho´
)
-Andreas
got some tricky problem here:
(at least if I want to write good ISO C code)
typedef struct {
union
{
USHORT byte [512];
ULONG lword[512/4];
};
} raw_s;
Of course, when the compiler is set to accept ISO code only. this will
output the warning:
"unnamed structures/unions are not allowed in ISO C".
So I tried to do
typedef struct {
union
{
USHORT byte [512];
ULONG lword[512/4];
} raw_u;
} raw_s;
Now one of my core functions complains that raw_s has no member named 'byte'
(nor lword)
How can I solve this and still comply to the ISO C standard?
Curiously, if I ignore the warning of the first solution, it works a treat
anyway (well, not ISO tho´
-Andreas