In sectino 6.5.7.2 of the Standard, I believe it states that variable length arrays (VLAs) are supported as long as they are not in file-scope.
But maybe someone can check out Example 4 and give me a better explanation. I don't think its perfectly clear where and what I am allowed to do. Let alone what tcc is striving to do... Thanks. On Wed, Jun 17, 2009 at 5:16 AM, Joshua Phillips<jp.sittingd...@gmail.com> wrote: > 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: 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 > > > > _______________________________________________ > Tinycc-devel mailing list > Tinycc-devel@nongnu.org > http://lists.nongnu.org/mailman/listinfo/tinycc-devel > > _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/tinycc-devel