diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2006-01-26 18:50:37 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2006-01-26 18:50:37 +0000 |
commit | f4e9414ef87ba277f02cf9d66d6f40304e877cb7 (patch) | |
tree | 5f651bd0ed5cebb8605697501f8758fbcf305fb8 /gcc/testsuite | |
parent | e046a30ab14ee10d1d4e0cbc179199c754192270 (diff) | |
download | gcc-f4e9414ef87ba277f02cf9d66d6f40304e877cb7.zip gcc-f4e9414ef87ba277f02cf9d66d6f40304e877cb7.tar.gz gcc-f4e9414ef87ba277f02cf9d66d6f40304e877cb7.tar.bz2 |
re PR c/25892 (-Wpointer-sign creates problems for Emacs)
gcc/ChangeLog:
PR c/25892
* c.opt (Wpointer-sign): Init to -1.
* c-opts.c (c_common_handle_option): Set to 1 on OPT_Wall and
OPT_pedantic, to 0 otherwise.
* doc/invoke.texi: Update.
gcc/testsuite/ChangeLog:
PR c/25892
* gcc.dg/Wpointer-sign.c: New.
* gcc.dg/Wpointer-sign-Wall.c: New.
* gcc.dg/Wpointer-sign-Wall-no.c: New.
* gcc.dg/Wpointer-sign-pedantic.c: New.
* gcc.dg/Wpointer-sign-pedantic-no.c: New.
* gcc.dg/conv-2.c: Use -Wpointer-sign.
From-SVN: r110265
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/Wpointer-sign-Wall-no.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/Wpointer-sign-Wall.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/Wpointer-sign-pedantic-no.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/Wpointer-sign-pedantic.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/Wpointer-sign.c | 13 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/conv-2.c | 2 |
7 files changed, 60 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0042b36..7b2477a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2006-01-26 Alexandre Oliva <aoliva@redhat.com> + + PR c/25892 + * gcc.dg/Wpointer-sign.c: New. + * gcc.dg/Wpointer-sign-Wall.c: New. + * gcc.dg/Wpointer-sign-Wall-no.c: New. + * gcc.dg/Wpointer-sign-pedantic.c: New. + * gcc.dg/Wpointer-sign-pedantic-no.c: New. + * gcc.dg/conv-2.c: Use -Wpointer-sign. + 2006-01-26 Andrew Pinski <pinskia@physics.uc.edu> PR C/25861 diff --git a/gcc/testsuite/gcc.dg/Wpointer-sign-Wall-no.c b/gcc/testsuite/gcc.dg/Wpointer-sign-Wall-no.c new file mode 100644 index 0000000..23df207 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wpointer-sign-Wall-no.c @@ -0,0 +1,9 @@ +/* This is from PR c/25892. See Wpointer-sign.c for more details. */ + +/* { dg-options "-Wno-pointer-sign -Wall" } */ + +void foo(unsigned long* ulp); + +void bar(long* lp) { + foo(lp); +} diff --git a/gcc/testsuite/gcc.dg/Wpointer-sign-Wall.c b/gcc/testsuite/gcc.dg/Wpointer-sign-Wall.c new file mode 100644 index 0000000..e72d37a --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wpointer-sign-Wall.c @@ -0,0 +1,9 @@ +/* This is from PR c/25892. See Wpointer-sign.c for more details. */ + +/* { dg-options "-Wall" } */ + +void foo(unsigned long* ulp); + +void bar(long* lp) { + foo(lp); /* { dg-warning "differ in signedness" } */ +} diff --git a/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic-no.c b/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic-no.c new file mode 100644 index 0000000..d4f597f --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic-no.c @@ -0,0 +1,9 @@ +/* This is from PR c/25892. See Wpointer-sign.c for more details. */ + +/* { dg-options "-Wno-pointer-sign -pedantic" } */ + +void foo(unsigned long* ulp); + +void bar(long* lp) { + foo(lp); +} diff --git a/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic.c b/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic.c new file mode 100644 index 0000000..25e2520 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic.c @@ -0,0 +1,9 @@ +/* This is from PR c/25892. See Wpointer-sign.c for more details. */ + +/* { dg-options "-pedantic" } */ + +void foo(unsigned long* ulp); + +void bar(long* lp) { + foo(lp); /* { dg-warning "differ in signedness" } */ +} diff --git a/gcc/testsuite/gcc.dg/Wpointer-sign.c b/gcc/testsuite/gcc.dg/Wpointer-sign.c new file mode 100644 index 0000000..74cdbe4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wpointer-sign.c @@ -0,0 +1,13 @@ +/* This is from PR c/25892. The SC promised RMS that -Wpointer-sign + would be off by default in GCC 4.1 to avoid inconvenient warnings + while compiling GNU Emacs. It should be enabled with -Wall and/or + -pedantic, though. Make sure it's off by default in this test (so + use dg-options "" to avoid passing -pedantic-errors). */ + +/* { dg-options "" } */ + +void foo(unsigned long* ulp); + +void bar(long* lp) { + foo(lp); +} diff --git a/gcc/testsuite/gcc.dg/conv-2.c b/gcc/testsuite/gcc.dg/conv-2.c index 349c8ac..ac95584 100644 --- a/gcc/testsuite/gcc.dg/conv-2.c +++ b/gcc/testsuite/gcc.dg/conv-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "" } */ +/* { dg-options "-Wpointer-sign" } */ void f1(long *); void f2(unsigned long *); |