-
- Downloads
Improve error message for excess elements in array initializer from {"a"}
So char arrays are not the only type that be initialized from {"a"}. We can have wchar_t (L"") and char16_t (u"") types too. So let's print out the type of the array instead of just saying char. Note in the testsuite I used regex . to match '[' and ']' as I could not figure out how many '\' I needed. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/c/ChangeLog: * c-typeck.cc (process_init_element): Print out array type for excessive elements. gcc/testsuite/ChangeLog: * gcc.dg/init-bad-1.c: Update error message. * gcc.dg/init-bad-2.c: Likewise. * gcc.dg/init-bad-3.c: Likewise. * gcc.dg/init-excess-3.c: Likewise. * gcc.dg/pr61096-1.c: Likewise.
Showing
- gcc/c/c-typeck.cc 1 addition, 1 deletiongcc/c/c-typeck.cc
- gcc/testsuite/gcc.dg/init-bad-1.c 1 addition, 1 deletiongcc/testsuite/gcc.dg/init-bad-1.c
- gcc/testsuite/gcc.dg/init-bad-2.c 1 addition, 1 deletiongcc/testsuite/gcc.dg/init-bad-2.c
- gcc/testsuite/gcc.dg/init-bad-3.c 1 addition, 1 deletiongcc/testsuite/gcc.dg/init-bad-3.c
- gcc/testsuite/gcc.dg/init-excess-3.c 6 additions, 6 deletionsgcc/testsuite/gcc.dg/init-excess-3.c
- gcc/testsuite/gcc.dg/pr61096-1.c 1 addition, 1 deletiongcc/testsuite/gcc.dg/pr61096-1.c
Loading
Please register or sign in to comment