[Haifux] Intermingled code and declarations and gcc
eli at billauer.co.il
Thu Sep 17 13:51:50 IDT 2009
I'm trying to compile some code using gcc 2.96 (gcc 3.0.4 gets crazy on
some other issue. Haven't tried on gcc 4 yet, but that's a bit far
fetched right now).
The offending rows are more or less (edited a bit for clarity):
/* count number of environment variables currently set */
unsigned int envar_count;
for (envar_count=0; envp[envar_count] != NULL; envar_count++);
Apparent problem: The compiler doesn't like the char declaration
following "real" code. Can't move the declaration before it, because the
array's size depends on the result of the code.
I would be so happy if someone popped up and said, "just use the
More information about the Haifux