From f3b6fbc2824bce3407f99b82918c6c2f63fad60c Mon Sep 17 00:00:00 2001 From: mrs Date: Sat, 24 Jul 2004 07:32:15 +0000 Subject: * c-typeck.c (convert_for_assignment): Tightened up pointer converstions that differ in signedness. Apple Radar 2535328. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85114 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/gcc.dg/conv-2.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/conv-2.c (limited to 'gcc/testsuite/gcc.dg/conv-2.c') diff --git a/gcc/testsuite/gcc.dg/conv-2.c b/gcc/testsuite/gcc.dg/conv-2.c new file mode 100644 index 00000000000..349c8acceed --- /dev/null +++ b/gcc/testsuite/gcc.dg/conv-2.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-options "" } */ + +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-warning " pointer targets in assignment differ in signedness" } */ + lp = ulp; /* { dg-warning " pointer targets in assignment differ in signedness" } */ + f1(ulp); /* { dg-warning " differ in signedness" } */ + f2(lp); /* { dg-warning " differ in signedness" } */ + + cp = ucp; /* { dg-warning " pointer targets in assignment differ in signedness" } */ + cp = scp; /* { dg-warning " pointer targets in assignment differ in signedness" } */ + ucp = scp; /* { dg-warning " pointer targets in assignment differ in signedness" } */ + ucp = cp; /* { dg-warning " pointer targets in assignment differ in signedness" } */ + scp = ucp; /* { dg-warning " pointer targets in assignment differ in signedness" } */ + scp = cp; /* { dg-warning " pointer targets in assignment differ in signedness" } */ +} -- cgit v1.2.1