enum{f,g=f};
The problem (if any) is that the value for g references f,
which is defined in an enum not yet completed.
TIA,
Francois Grieu
f == 0
g == 0
Yes, it's valid.
C99 6.2.1p7:
Each enumeration constant has scope that begins just after the
appearance of its defining enumerator in an enumerator list.
Note that an "enumerator" includes the "= constant" if present, so
"enum { x = x }" is illegal (unless another x was previously declared
in an enclosing scope, but that's ugly so don't do it).
--
Keith Thompson (The_Other_Keith) ks...@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Francois Grieu