tcc can't compile the attached VLA check (gcc works)
and configure adds "#define __STDC_NO_VLA__ 1" to config.h

The code was generated using the autoconf macro "AC_C_VARARRAYS".

console output:
tcc -std=c11  vla_conftest.c -c
vla_conftest.c:30: error: constant expression expected


Any ideas, how to fix that?

(Link does not work: n is not available)


--
Bye bye ... Detlef
/* confdefs.h */

/* end confdefs.h.  */

/* Test for VLA support.  This test is partly inspired
                  from examples in the C standard.  Use at least two VLA
                  functions to detect the GCC 3.4.3 bug described in:
                  
https://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html
                  */
               #ifdef __STDC_NO_VLA__
                syntax error;
               #else
                 extern int n;
                 int B[100];
                 int fvla (int m, int C[m][m]);

                 int
                 simple (int count, int all[static count])
                 {
                   return all[count - 1];
                 }

                 int
                 fvla (int m, int C[m][m])
                 {
                   typedef int VLA[m][m];
                   VLA x;
                   int D[m];

                   static int (*q)[m] = &B;

                   int (*s)[n] = q;
                   return C && &x[0][0] == &D[0] && &D[0] == s[0];
                 }
               #endif

int
main (void)
{

  ;
  return 0;
}
_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to