On 29 Oct 2007, at 23:12, Quentin Mathé wrote:

> Le 28 oct. 07 à 11:20, Mildred a écrit :
>
>> While building files for EtoileFoundation framework, I get this error
>> message:
>>
>> ETCArray.c: In function ‘ETCArrayIndexOfObjectIdenticalTo’:
>> ETCArray.c:156: error: ‘for’ loop initial declaration used outside
>> C99 mode
>> ETCArray.c: In function ‘ETCArrayRemoveAllObjects’:
>> ETCArray.c:170: error: ‘for’ loop initial declaration used outside
>> C99 mode

Weird.  I compiled this this morning with no problems (GCC4.2, FreeBSD  
7).  I just tried again and it failed.

> In all GCC versions (except Apple one) that I have used until now,
> C99 wasn't enabled by default.

The Apple one doesn't default to C99 either; you have to set it in  
XCode for each project.

>> I tried the command line:
>>      make CFLAGS="$CFLAGS -std=c99"
>> but it doesn't work at all.

The correct syntax for that would be:

CFLAGS="$CFLAGS -std=c99" make

> I had the same issue the first time I tried to enable C99, it's a bit
> weird that doesn't work.
> make CPPFLAGS="$CPPFLAGS -std=c99" should work well.

CPPFLAGS sets the flags for the preprocessor.

> For GNUmakefile like etoile.make, what you have to use is:
> ADDITIONAL_CPPFLAGS += -std=c99
> or
> ADDITIONAL_OBJCFLAGS += -std=c99

The problem here is that it's a C file.  I remembered to set -std=c99  
for Objective-C, but not for C.  Somehow I think the Objective-C flags  
got picked up for C the first few times I compiled it (GNUstep make is  
just plain weird; it seems to cache things very aggressively and  
ignore changes in the makefile half the time).

>> Have you any suggestions how to solve that ? Maybe modify a
>> GNUmakefile
>> somewhere (I don't want to modify the system makefiles, that is
>> outside
>> of the Étoilé tree. But there may be a way to add CFLAGS somewhere in
>> the Makefiles of the Étoilé tree ...)

I've fixed it in svn now.

David


_______________________________________________
Etoile-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-discuss

Répondre à