This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH preprocessor/61389] - libcpp diagnostics shouldn't talk about ISO C99 for C++ input files


> Here is a preprocessor patch to make error messages show C++11 
> and other relevant C++ language instead of C99.
>
> Built and tested on x86_64-linux.

This caused

FAIL: gcc.dg/cpp/macsyntx.c (test for excess errors)
FAIL: gcc.dg/cpp/macsyntx.c (test for excess errors)
FAIL: gcc.dg/cpp/macsyntx.c  (test for warnings, line 54)
FAIL: gcc.dg/cpp/macsyntx.c  (test for warnings, line 54)
FAIL: gcc.dg/cpp/macsyntx.c  (test for warnings, line 55)
FAIL: gcc.dg/cpp/macsyntx.c  (test for warnings, line 55)
FAIL: gcc.dg/cpp/macsyntx.c  (test for warnings, line 62)
FAIL: gcc.dg/cpp/macsyntx.c  (test for warnings, line 62)
FAIL: gcc.dg/cpp/sysmac1.c (test for excess errors)
FAIL: gcc.dg/cpp/sysmac1.c (test for excess errors)
FAIL: gcc.dg/cpp/sysmac1.c  (test for warnings, line 25)
FAIL: gcc.dg/cpp/sysmac1.c  (test for warnings, line 25)

(see https://gcc.gnu.org/ml/gcc-regression/2014-07/msg00162.html).

The warnings have to be adjusted as in

--- ../_clean/gcc/testsuite/gcc.dg/cpp/macsyntx.c	2014-05-10 23:17:13.000000000 +0200
+++ gcc/testsuite/gcc.dg/cpp/macsyntx.c	2014-07-11 15:57:33.000000000 +0200
@@ -51,15 +51,15 @@ one(ichi\
 two(ichi)			/* { dg-error "requires 2" } */
 var0()				/* OK.  */
 var0(ichi)			/* OK.  */
-var1()				/* { dg-warning "rest arguments to be used" } */
-var1(ichi)			/* { dg-warning "rest arguments to be used" } */
+var1()				/* { dg-warning "ISO C99 requires at least one argument" } */
+var1(ichi)			/* { dg-warning "ISO C99 requires at least one argument" } */
 var1(ichi, ni)			/* OK.  */
 
 /* This tests two oddities of GNU rest args - omitting a comma is OK,
    and backtracking a token on pasting an empty rest args.  */
 #define rest(x, y...) x ## y	/* { dg-warning "ISO C" } */
 rest(ichi,)			/* OK.  */
-rest(ichi)			/* { dg-warning "rest arguments to be used" } */
+rest(ichi)			/* { dg-warning "ISO C99 requires at least one argument" } */
 #if 23 != rest(2, 3)		/* OK, no warning.  */
 #error 23 != 23 !!
 #endif
--- ../_clean/gcc/testsuite/gcc.dg/cpp/sysmac1.c	2014-05-10 23:17:12.000000000 +0200
+++ gcc/testsuite/gcc.dg/cpp/sysmac1.c	2014-07-11 15:59:18.000000000 +0200
@@ -22,5 +22,5 @@
 (str);				/* { dg-warning "used with arguments" } */
 (sys_str);			/* { dg-bogus "used with arguments" } */
 
-foo (one_arg);			/* { dg-warning "requires rest arguments" } */
+foo (one_arg);			/* { dg-warning "ISO C99 requires at least one argument" } */
 sys_foo (one_arg);		/* { dg-bogus "requires rest arguments" } */

Dominique


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]