Hi,

it turns out that in this test case the expected output depends on the COLUMNS
setting of the terminal where the test suite is started.  With less than 82 
columns
the multiline output is not as expected.

The reason for that seems to be at diagnostic_set_caret_max_width where
it is dependent on isatty(fileno(stderr)) if get_terminal_width gets called.
And looking at get_terminal_width it is clear that the different COLUMNS
setting make the difference.

With the following patch the test case succeeds independently of the terminal
settings.


Is it OK for trunk?


Thanks
Bernd.
2016-08-20  Bernd Edlinger  <bernd.edlin...@hotmail.de>

	PR c/52952
	* gcc.dg/cpp/pr66415-1.c: Fix sporadic failure.

Index: gcc/testsuite/gcc.dg/cpp/pr66415-1.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/pr66415-1.c	(revision 239624)
+++ gcc/testsuite/gcc.dg/cpp/pr66415-1.c	(working copy)
@@ -1,6 +1,7 @@
 /* PR c/66415 */
 /* { dg-do compile } */
 /* { dg-options "-Wformat -fdiagnostics-show-caret" } */
+/* { dg-set-compiler-env-var COLUMNS "82" } */
 
 void
 fn1 (void)

Reply via email to