Hi,

Le 28 oct. 07 à 11:20, Mildred a écrit :

> Hi,
>
> I have problems compiling Étoilé SVN. That's a silly problem but I
> don't know how to solve it (and I don't know why it does appears)
>
> 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
>
> I don't know why gcc complains, usually it does not. I'm using gcc  
> 4.2.2, maybe it does matter. I know that adding the flag -std=c99  
> would solve the problem but I don't know how to add it.

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

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

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.

> I also tried to add the line
>       CFLAGS += -std=c99
> to etoile.make but it doesn't have any effect.

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

> 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'm going to fix EtoileFoundation. I will probably update etoile.make  
too, so C99 will automatically be set. However modules without any  
dependencies like EtoileFoundation would still need to declare the  
flag by themselves in order to support compilation when moved outside  
of  a repository working copy.

Cheers,
Quentin.


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

Répondre à