Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000093 [cparser] unknown major always 2011-11-23 17:12 2011-12-24 03:47
Reporter cas View Status public  
Assigned To Matze
Priority normal Resolution fixed  
Status closed   Product Version 0.9.12
Summary 0000093: Compound literals are not considered constant expressions
Description The following, at file scope:

static char **x = (char *[]){ "A" };

fails to build:

error: initialisation expression '(char*[]){ "A" }' is not constant

As far as I can tell, this is valid code. Initializers can be address constants, including the implicit conversion to pointer of an array (C99 6.6). The type of a compound literal is the type name (with the array size filled in by the compiler if necessary), and at file scope, the storage duration is static (C99 6.5.2.5). The above initializer is at file scope, and has array type, so it qualifies as an address constant.
Additional Information This is actually cparser 0.9.12, but that version is not available in the dropbox.
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0000141)
Matze (administrator)
2011-11-24 21:15

confirmed, fix is nearly ready...
(0000142)
Matze (administrator)
2011-11-24 23:12

fixed in revision 0f2ec395207f37e50c10f3572f82cedc90ee36a4

- Issue History
Date Modified Username Field Change
2011-11-23 17:12 cas New Issue
2011-11-24 21:15 Matze Note Added: 0000141
2011-11-24 21:15 Matze Assigned To => Matze
2011-11-24 21:15 Matze Status new => assigned
2011-11-24 21:15 Matze version 0.9.10 => 0.9.12
2011-11-24 23:12 Matze Note Added: 0000142
2011-11-24 23:12 Matze Status assigned => resolved
2011-11-24 23:12 Matze Resolution open => fixed
2011-12-24 03:47 Matze Status resolved => closed


Mantis 1.1.5[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker