If tcc is supposed to compile ISO C, it is right to complain.
If tcc wants to compile all what gcc compiles it has to support all gcc
extensions as the one you're using with this sample.

IMHO a compiler should compile all valid code as determined by a standard
(in our case different published versions ISO/IEC 9899 standard) and reject
all other forms. So, tcc does the right job in your case.

If you're bound to a specific language extension you're also bound a
specific compiler and you'll easily compile your code on another compiler.

You'd better rewrite your code so that is complies with the C standard
level/version you want to support.

C.

-----Original Message-----
From: tinycc-devel-bounces+eligis=wanadoo...@nongnu.org
[mailto:tinycc-devel-bounces+eligis=wanadoo...@nongnu.org] On Behalf Of
Ammar James
Sent: Tuesday, June 16, 2009 21:54
To: tinycc-devel@nongnu.org
Subject: [Tinycc-devel] tcc and declaring arrays.

Another area where gcc compiles fine while tcc issues an error.

Essentially:
int i;
i = strlen(s);
int s2[i];      //tcc doesn't like this.

tcc's error message is: wrong3.c:9: constant expression expected

Code attached (21 lines).

----------------------------------------------------------------------------
-----------
Orange vous informe que cet  e-mail a ete controle par l'anti-virus mail. 
Aucun virus connu a ce jour par nos services n'a ete detecte.






_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to