(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? You should see an additional FAIL for an excess warning. Martin