sam_cit@yahoo.co.in wrote On 11/15/06 11:34,:
Quote:
Hi Everyone,
>
I have a structure typedefed as
>
typedef strcut
{
#if(MACRO == TRUE)
int a;
int b;
#endif
} SAMPLE_STRUCT;
>
Now does this give compile properly?
If the compiler issues a diagnostic, it has behaved
"properly." If it doesn't, it has behaved "improperly."
If you change `strcut' to `struct', then what happens
depends on how MACRO is defined. If the #if test fails and
the `a' and `b' declarations are omitted, then the compiler
acts "properly" if and only if it emits a diagnostic.
Quote:
If not, i might be expected to
add another temp variable in the structure which might not be used by
my application at all, is there any workaround for this scenario?
What do you mean by "is there any workaround?" What are
you trying to achieve? A struct containing no elements -- if
C permitted such a thing, which it doesn't -- seems a rather
useless object, not likely to help you toward any goal I can
think of off-hand.
--
Eric.Sosman@sun.com