Array initialization with a non-array is expected to fail#131
Array initialization with a non-array is expected to fail#131kroening merged 1 commit intodiffblue:masterfrom
Conversation
|
My clang here (Apple LLVM version 7.3.0 (clang-703.0.31)) still eats it? What does the standard say? |
|
@kroening Did you specify -Werror, or at least -Wall? |
|
Yes! |
|
Oh, sorry, it takes both -Wall and -Werror ... (which actually makes sense): |
4ce0337 to
b3ae793
Compare
b3ae793 to
7e4b491
Compare
|
I.e., this is still a bug? Close the pull request? |
|
This pull request would just change one "KNOWNBUG" to a proper "CORE" test as goto-cc produces the expected result. (At least I'd claim it is the expected result.) |
|
Yes, but claim it's the wrong result! |
0703b4e to
20ecab6
Compare
|
@tautschnig what is the status of this? Travis fails with |
|
I had failed to parse @kroening last response on this PR. I'll have to take another look as to why this is now failing. |
20ecab6 to
93d1b8d
Compare
|
My suggestion would be to issue a warning instead of an error, just as gcc/clang do. |
93d1b8d to
14881e1
Compare
14881e1 to
3252eec
Compare
|
@kroening This is finally addressed following your suggestions. Review much appreciated. |
3252eec to
1f205e8
Compare
|
It seems that #1111 is now getting urgent. |
clang -Wall says:
Struct_Initialization1/main.c:16:38: warning: suggest braces around initialization of subobject [-Wmissing-braces]
struct _classinfo nullclass1 = { 42, 1, 2, 3, 4 };
^~~~
{ }
and then constructs a suitable object.
Our implementation now attempts to build an initializer list if a
variable-length array is encountered; if this succeeds, the same suitable object
is constructed. Variable-length arrays in the middle of a struct are not
permitted (neither by GCC nor Clang or our C front-end).
1f205e8 to
9740142
Compare
…et_invalid Removed get_invalid
…less_PR Added operator less for class argidx_and_tokennamet.
In the past, this failed an internal assertion; nowadays a proper error is
reported to the user. clang -Werror says: