Commit f2fd3821 by Andreas Jaeger

[multiple changes]

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.

From-SVN: r93813
parent e1b83ac7
......@@ -3651,7 +3651,7 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
|| target_cmp)
;
/* If there is a mismatch, do warn. */
else
else if (warn_pointer_sign)
WARN_FOR_ASSIGNMENT (N_("pointer targets in passing argument "
"%d of %qE differ in signedness"),
N_("pointer targets in assignment "
......
; 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.
;
......@@ -430,6 +430,10 @@ Wwrite-strings
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
......@@ -242,7 +242,7 @@ Objective-C and Objective-C++ Dialects}.
@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}.
......@@ -3135,6 +3135,12 @@ effectively. Often, the problem is that your code is too big or too
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.
......@@ -10900,7 +10906,7 @@ However, when @option{-mbackchain} is also in effect, the topmost word of
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
......
2005-01-18 Michael Matz <matz@suse.de>
* gcc.dg/Wno-pointer-sign.c: New test for -Wno-pointer-sign.
2005-01-17 Diego Novillo <dnovillo@redhat.com>
PR tree-optimization/19121
......
/* { 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" } */
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment