This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/36901] pedwarn() + -pedantic-errors + -w (inhibit_warnings) should not emit errors
- From: "manu at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Aug 2008 20:38:56 -0000
- Subject: [Bug other/36901] pedwarn() + -pedantic-errors + -w (inhibit_warnings) should not emit errors
- References: <bug-36901-13511@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #10 from manu at gcc dot gnu dot org 2008-08-09 20:38 -------
Yeah, silly me, it obviously fails because there is no "next" pr36901.h to
include.
Since we include limits.h, we are at the mercy of the contents of the limits.h
that is found. This isn't very reliable. We just need to a pedantic warning in
the header. This works in x86_64, could you test on your side?
Index: gcc/testsuite/gcc.dg/pr36901-3.c
===================================================================
--- gcc/testsuite/gcc.dg/pr36901-3.c (revision 138906)
+++ gcc/testsuite/gcc.dg/pr36901-3.c (working copy)
@@ -4,7 +4,6 @@
void foo(void)
{
int s = sc;
}
/* { dg-message "file included" "In file included" { target *-*-* } 0 } */
-/* { dg-warning "overflow" "overflow" { target *-*-* } 0 } */
-/* { dg-error "overflow" "overflow" { target *-*-* } 0 } */
+/* { dg-error "ordered comparison of pointer with integer zero" "pedantic
error" { target *-*-* } 0 } */
Index: gcc/testsuite/gcc.dg/pr36901-4.c
===================================================================
--- gcc/testsuite/gcc.dg/pr36901-4.c (revision 138906)
+++ gcc/testsuite/gcc.dg/pr36901-4.c (working copy)
@@ -4,8 +4,6 @@
void foo(void)
{
int s = sc;
}
/* { dg-message "from " "In file included" { target *-*-* } 0 } */
-/* { dg-warning "overflow" "overflow" { target *-*-* } 0 } */
-/* { dg-error "overflow" "overflow" { target *-*-* } 0 } */
-/* { dg-error "#include_next is a GCC extension" "#include_next" { target
*-*-* } 0 } */
+/* { dg-error "ordered comparison of pointer with integer zero" "pedantic
error" { target *-*-* } 0 } */
Index: gcc/testsuite/gcc.dg/pr36901.h
===================================================================
--- gcc/testsuite/gcc.dg/pr36901.h (revision 138906)
+++ gcc/testsuite/gcc.dg/pr36901.h (working copy)
@@ -1,2 +1,2 @@
-#include <limits.h>
-static int sc = INT_MAX + 1;
+int sc = (&sc > 0);
+
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36901