On Sun, Oct 01, 2023 at 09:37:59AM +0200, Martin Uecker wrote: > > (I shortened the recipient list) > > Am Sonntag, dem 01.10.2023 um 02:55 +0200 schrieb Alejandro Colomar: > > > > > ... > > I ran the tests, and get some unexpected failure. I used dg-warning, > > but maybe I used it wrong? Here's the output: > > > > ``` > > output is: > > /home/alx/src/gnu/gcc/wustr/gcc/testsuite/gcc.dg/Wunterminated-string-initialization.c:5:14: > > warning: initializer-string for array of 'char' is too long > > [-Wunterminated-string-initi > > alization] > > > > FAIL: gcc.dg/Wunterminated-string-initialization.c (test for warnings, > > line 5) > > ``` > > > > And here's the test: > > > > ``` > > /* { dg-do compile } */ > > /* { dg-options "-Wunterminated-string-initialization" } */ > > > > char a1[] = "a"; > > char a2[1] = "a"; /* { dg-warning "unterminated char sequence" } */ > > char a3[2] = "a"; > > ``` > > > > Why isn't it expecting the warning? > > Because the text does not match the actual output above?
Makes sense. Here's the output after a fix (which I'll send soon as a new revision): ``` output is: /home/alx/src/gnu/gcc/wustr/gcc/testsuite/gcc.dg/Wunterminated-string-initialization.c:5:14: warning: initializer-string for array of 'char' is too long [-Wunterminated-string-initialization] ``` and ``` === gcc Summary === # of expected passes 2 ``` The only thing that concerns me a little bit is that I don't see any PASS (or XFAIL). > You should see an additional FAIL for an excess warning. Yep, I did. Cheers, Alex > > Martin > > > >
signature.asc
Description: PGP signature