tinycc-devel
[Top][All Lists]
Advanced

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

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


From: Joshua Phillips
Subject: Re: [Tinycc-devel] tcc and declaring arrays.
Date: Wed, 17 Jun 2009 09:16:20 +0000
User-agent: KMail/1.9.10

Variable length arrays are valid C99.

On Wednesday 17 June 2009 07:01:15 Christian Jullien wrote:
> 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: 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.
>
> 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
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/tinycc-devel


Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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