From dc8d273907ba88cf11180a2fdf79f086feeb44f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20L=C3=B3pez-Ib=C3=A1=C3=B1ez?= Date: Fri, 9 Apr 2010 07:49:41 +0000 Subject: re PR c++/28584 (Cast to pointer from integer of different size) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2010-04-09 Manuel López-Ibáñez PR c++/28584 * c.opt (Wint-to-pointer-cast): Available in C++. * doc/invoke.texi (Wint-to-pointer-cast): Available in C++. cp/ * typeck.c (cp_build_c_cast): Warn for casting integer to larger pointer type. testsuite/ * gcc.dg/Wint-to-pointer-cast-1.c: Move to... * c-c++-common/Wint-to-pointer-cast-1.c: ... here. * gcc.dg/Wint-to-pointer-cast-2.c: Move to... * c-c++-common/Wint-to-pointer-cast-2.c: ... here. * gcc.dg/Wint-to-pointer-cast-3.c: Move to... * c-c++-common/Wint-to-pointer-cast-3.c: ... here. Update. * g++.old-deja/g++.mike/warn1.C: Add -Wno-int-to-pointer-cast. * g++.dg/other/increment1.C: Likewise. From-SVN: r158150 --- gcc/doc/invoke.texi | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc/doc') diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 7a8ca55..ad7d097 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -4284,11 +4284,13 @@ warning about it. The restrictions on @samp{offsetof} may be relaxed in a future version of the C++ standard. -@item -Wno-int-to-pointer-cast @r{(C and Objective-C only)} +@item -Wno-int-to-pointer-cast @opindex Wno-int-to-pointer-cast @opindex Wint-to-pointer-cast Suppress warnings from casts to pointer type of an integer of a -different size. +different size. In C++, casting to a pointer type of smaller size is +an error. @option{Wint-to-pointer-cast} is enabled by default. + @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)} @opindex Wno-pointer-to-int-cast -- cgit v1.1