M
michael potter
I would like to code a prototype that returns an enum, but not declare
the enum.
This works on several systems and compilers, but fails on aix xlc.
Here is the sample code:
enum anEnum someFunc(void);
when i run:
xlc -c someFunc.c
i get
1506-103 (W) Tag anEnum requires a complete definition before it is
used.
Obviously, I could declare the enum, but
I would like to avoid declaring the enum as I would like
to hide the values of the enum from functions that don't need it.
I use a similar technique to hide the members of a struct; I just pass
the pointer to the struct and the compiler does not require a full
definition
of the struct.
How can I eliminate that warning message without eliminating other
warning messages and without declaring the enum?
the enum.
This works on several systems and compilers, but fails on aix xlc.
Here is the sample code:
enum anEnum someFunc(void);
when i run:
xlc -c someFunc.c
i get
1506-103 (W) Tag anEnum requires a complete definition before it is
used.
Obviously, I could declare the enum, but
I would like to avoid declaring the enum as I would like
to hide the values of the enum from functions that don't need it.
I use a similar technique to hide the members of a struct; I just pass
the pointer to the struct and the compiler does not require a full
definition
of the struct.
How can I eliminate that warning message without eliminating other
warning messages and without declaring the enum?