diff options
| author | Romain Francoise <rfrancoise@debian.org> | 2010-03-13 18:07:57 +0100 |
|---|---|---|
| committer | Thomas Preud'homme <thomas.preudhomme@celest.fr> | 2010-04-15 19:04:25 +0200 |
| commit | 6655e06ec851e3541f2f47187f95956e5003c7b8 (patch) | |
| tree | 7d88b2fb5edc38017dff425a0e11151b68707d54 /tccgen.c | |
| parent | d2cf970a414ead8d90155c3569d9ab197cc099eb (diff) | |
| download | tinycc-6655e06ec851e3541f2f47187f95956e5003c7b8.tar.gz tinycc-6655e06ec851e3541f2f47187f95956e5003c7b8.tar.bz2 | |
Error out on bad char array initialization
Error out with an explicit message when trying to initialize a
character array with something that's not a literal (optionally
enclosed in braces) as per C99 6.7.8:14; thanks to Antti-Juhani
Kaijanaho <ajk@debian.org> who did all the work.
Diffstat (limited to 'tccgen.c')
| -rw-r--r-- | tccgen.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -4690,6 +4690,9 @@ static void decl_initializer(CType *type, Section *sec, unsigned long c, no_oblock = 1; if ((first && tok != TOK_LSTR && tok != TOK_STR) || tok == '{') { + if (tok != '{') + error("character array initializer must be a literal," + " optionally enclosed in braces"); skip('{'); no_oblock = 0; } |
