From b9edb4b11c99720e10625b41d37dc440bd468f2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20L=C3=B3pez-Ib=C3=A1=C3=B1ez?= Date: Tue, 30 Jan 2007 22:29:11 +0000 Subject: re PR c++/24745 (unpleasant warning for "if (NULL)") 2007-01-30 Manuel Lopez-Ibanez PR c++/24745 * doc/invoke.texi (Wpointer-arith): Document warning. cp/ * typeck.c (build_binary_op): Fix logic for warning. Move warning to -Wpointer-arith. * call.c (convert_like_real): Don't warn when converting to boolean type. testsuite/ * g++.dg/warn/null4.C: New. From-SVN: r121361 --- gcc/doc/invoke.texi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/doc') diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index bd4bca6..31490b8 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -3153,7 +3153,8 @@ such assumptions. Warn about anything that depends on the ``size of'' a function type or of @code{void}. GNU C assigns these types a size of 1, for convenience in calculations with @code{void *} pointers and pointers -to functions. +to functions. In C++, warn also when an arithmetic operation involves +@code{NULL}. This warning is also enabled by @option{-pedantic}. @item -Wbad-function-cast @r{(C only)} @opindex Wbad-function-cast -- cgit v1.1