+2004-07-23 Mike Stump <mrs@apple.com>
+
+ * c-typeck.c (convert_for_assignment): Tightened up pointer converstions
+ that differ in signedness.
+
2004-07-23 Zack Weinberg <zack@codesourcery.com>
* genmodes.c (make_vector_modes): Mark with ATTRIBUTE_UNUSED.
|| target_cmp)
;
/* If there is a mismatch, do warn. */
- else if (pedantic)
+ else
warn_for_assignment ("pointer targets in %s differ in signedness",
errtype, funname, parmnum);
}
--- /dev/null
+/* { 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" } */
+}