summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Wno-pointer-sign.c
diff options
context:
space:
mode:
authoraj <aj@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-18 06:03:46 +0000
committeraj <aj@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-18 06:03:46 +0000
commit380bf74bc0fb2cbb9ada8c26906bc01ddddaeb37 (patch)
tree682eabeadb86e7ed4277488a966cfaae164aead2 /gcc/testsuite/gcc.dg/Wno-pointer-sign.c
parent0f9628989cba57915280082cc75194585348e22d (diff)
downloadgcc-380bf74bc0fb2cbb9ada8c26906bc01ddddaeb37.tar.gz
2005-01-18 Andi Kleen <ak@muc.de>
* c-typeck.c: (convert_for_assignment): Check warn_pointer_sign. * c.opt (-Wpointer-sign): Add. * doc/invoke.texi: (-Wpointer-sign): Add. 2005-01-18 Michael Matz <matz@suse.de> * gcc.dg/Wno-pointer-sign.c: New test for -Wno-pointer-sign. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@93813 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/Wno-pointer-sign.c')
-rw-r--r--gcc/testsuite/gcc.dg/Wno-pointer-sign.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/Wno-pointer-sign.c b/gcc/testsuite/gcc.dg/Wno-pointer-sign.c
new file mode 100644
index 00000000000..780c9d4e207
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wno-pointer-sign.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-Wno-pointer-sign" } */
+
+void f1(long *);
+void f2(unsigned long *);
+
+int main()
+{
+ long *lp;
+ unsigned long *ulp;
+ char *cp;
+ unsigned char *ucp;
+ signed char *scp;
+
+ ulp = lp; /* { dg-bogus " pointer targets in assignment differ in signedness" } */
+ lp = ulp; /* { dg-bogus " pointer targets in assignment differ in signedness" } */
+ f1(ulp); /* { dg-bogus " differ in signedness" } */
+ f2(lp); /* { dg-bogus " differ in signedness" } */
+
+ cp = ucp; /* { dg-bogus " pointer targets in assignment differ in signedness" } */
+ cp = scp; /* { dg-bogus " pointer targets in assignment differ in signedness" } */
+ ucp = scp; /* { dg-bogus " pointer targets in assignment differ in signedness" } */
+ ucp = cp; /* { dg-bogus " pointer targets in assignment differ in signedness" } */
+ scp = ucp; /* { dg-bogus " pointer targets in assignment differ in signedness" } */
+ scp = cp; /* { dg-bogus " pointer targets in assignment differ in signedness" } */
+}