Apologies. I had checked the docs at https://bellard.org/tcc/tcc-doc.html and they said VLAs were currently missing.
On 07/17/2017 04:20 PM, David Mertens wrote: > Hello Petr, > > Since tcc implements variable length arrays, why would we define > __STDC_NO_VLA__? > > David > > On Mon, Jul 17, 2017 at 9:50 AM, Petr Skočík <[email protected] > <mailto:[email protected]>> wrote: > > Hi. > > This adds > #define __STDC_NO_ATOMICS__ 1 > #define __STDC_NO_COMPLEX__ 1 > #define __STDC_NO_THREADS__ 1 > #define __STDC_NO_VLA__ 1 > and > an iso646.h header. > > I think it should included in tcc. > > I'm using an all of C header (https://pastebin.com/bjwRJY9Q) and if this > is part of tcc, I won't have to special-case the compiler inside the > header. > > Best regards, > Petr Skocik > > _______________________________________________ > Tinycc-devel mailing list > [email protected] <mailto:[email protected]> > https://lists.nongnu.org/mailman/listinfo/tinycc-devel > <https://lists.nongnu.org/mailman/listinfo/tinycc-devel> > > > > > -- > "Debugging is twice as hard as writing the code in the first place. > Therefore, if you write the code as cleverly as possible, you are, > by definition, not smart enough to debug it." -- Brian Kernighan > > > _______________________________________________ > Tinycc-devel mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/tinycc-devel >
>From 2b59d921e71c106f12e115351158913d043c8d8d Mon Sep 17 00:00:00 2001 From: Petr Skocik <[email protected]> Date: Mon, 17 Jul 2017 15:34:45 +0200 Subject: [PATCH] add missing standard macros and iso646.h --- include/iso646.h | 16 ++++++++++++++++ libtcc.c | 5 ++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 include/iso646.h diff --git a/include/iso646.h b/include/iso646.h new file mode 100644 index 0000000..8c1898f --- /dev/null +++ b/include/iso646.h @@ -0,0 +1,16 @@ +#ifndef _ISO646_H +#define _ISO646_H + +#define and && +#define and_eq &= +#define bitand & +#define bitor | +#define compl ~ +#define not ! +#define not_eq != +#define or || +#define or_eq |= +#define xor ^ +#define xor_eq ^= + +#endif diff --git a/libtcc.c b/libtcc.c index bf13724..dfd982f 100644 --- a/libtcc.c +++ b/libtcc.c @@ -1,7 +1,7 @@ /* * TCC - Tiny C Compiler * - * Copyright (c) 2001-2004 Fabrice Bellard + * Copyright (c) 2001-2004, 2017 Fabrice Bellard * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -775,6 +775,9 @@ LIBTCCAPI TCCState *tcc_new(void) tcc_define_symbol(s, "__STDC__", NULL); tcc_define_symbol(s, "__STDC_VERSION__", "199901L"); tcc_define_symbol(s, "__STDC_HOSTED__", NULL); + tcc_define_symbol(s, "__STDC_NO_ATOMICS__", "1"); + tcc_define_symbol(s, "__STDC_NO_COMPLEX__", "1"); + tcc_define_symbol(s, "__STDC_NO_THREADS__", "1"); /* target defines */ #if defined(TCC_TARGET_I386) -- 2.13.0
_______________________________________________ Tinycc-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/tinycc-devel
