summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-24 07:32:15 +0000
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-24 07:32:15 +0000
commitf3b6fbc2824bce3407f99b82918c6c2f63fad60c (patch)
tree4cf444c2c3e891ad3b1c389e8642423f7c1364c8 /gcc/testsuite
parent259ff1793e89d7cba08ae9588cebadeaa83d30ca (diff)
downloadgcc-f3b6fbc2824bce3407f99b82918c6c2f63fad60c.tar.gz
* 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
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/gcc.dg/conv-2.c26
1 files changed, 26 insertions, 0 deletions
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" } */
+}