; Options for the C, ObjC, C++ and ObjC++ front ends.
-; Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
C ObjC C++ ObjC++
Give strings the type \"array of char\"
+Wpointer-sign
+C ObjC Var(warn_pointer_sign) Init(1)
+Warn when a pointer differs in signedness in an assignment.
+
ansi
C ObjC C++ ObjC++
A synonym for -std=c89. In a future version of GCC it will become synonymous with -std=c99 instead
@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-@c 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+@c 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@ignore
@c man begin COPYRIGHT
Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
@gccoptlist{-Wbad-function-cast -Wmissing-declarations @gol
-Wmissing-prototypes -Wnested-externs -Wold-style-definition @gol
-Wstrict-prototypes -Wtraditional @gol
--Wdeclaration-after-statement}
+-Wdeclaration-after-statement -Wno-pointer-sign}
@item Debugging Options
@xref{Debugging Options,,Options for Debugging Your Program or GCC}.
complex; GCC will refuse to optimize programs when the optimization
itself is likely to take inordinate amounts of time.
+@item -Wno-pointer-sign
+@opindex Wno-pointer-sign
+Don't warn for pointer argument passing or assignment with different signedness.
+Only useful in the negative form since this warning is enabled by default.
+This option is only supported for C and Objective-C@.
+
@item -Werror
@opindex Werror
Make all warnings into errors.
the save area is always used to store the backchain, and the return address
register is always saved two words below the backchain.
-As long as the stack frame backchain is not used, code generated with
+As long as the stack frame backchain is not used, code generated with
@option{-mpacked-stack} is call-compatible with code generated with
@option{-mno-packed-stack}. Note that some non-FSF releases of GCC 2.95 for
S/390 or zSeries generated code that uses the stack frame backchain at run
--- /dev/null
+/* { 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" } */
+}