AIX C:constant expr in array decl breaks cc

Johann Schweigl johnny at edvvie.at
Sat Oct 14 15:49:34 AEST 1989


Is there *formally* anything wrong with the following global declaration:

void (*foo[2][0 + 1 + 1 + 1])() = {
	{ fun1, fun2, fun3 },
	{ fun4, fun5, fun6 }
};

AIX C will not compile this but issue an error saying a '}' is missing on
both initialization lines.
The compiler gets confused by the '[0 + 1 + 1 + 1]'. Replace it by [3]
and everything works fine. The addition chain was generated by the 
the preprocessor.
Should it be like this, or is this an error?
-- 
This does not reflect the   | Johann  Schweigl | DOS?
opinions of my employer.    | johnny at edvvie.at | Kind of complicated
I am busy enough by talking |                  | bootstrap loader ...
about my own ...            |   EDVG  Vienna   | 



More information about the Comp.unix.aix mailing list