[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Tinycc-devel] tcc and declaring arrays.

From: Christian Jullien
Subject: RE: [Tinycc-devel] tcc and declaring arrays.
Date: Wed, 17 Jun 2009 09:01:15 +0200

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.


-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of
Ammar James
Sent: Tuesday, June 16, 2009 21:54
To: address@hidden
Subject: [Tinycc-devel] tcc and declaring arrays.

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

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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]