From: Brendan Kehoe Date: Thu, 19 Feb 1998 09:55:51 +0000 (+0000) Subject: typeck.c (build_unary_op): Only warn about incr/decr a pointer if pedantic || warn_po... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e62d5b583306f95fdc41d51d56349598e341d30b;p=gcc.git typeck.c (build_unary_op): Only warn about incr/decr a pointer if pedantic || warn_pointer_arith. * typeck.c (build_unary_op): Only warn about incr/decr a pointer if pedantic || warn_pointer_arith. From-SVN: r18118 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0c5fff0538c..370d443d7b8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +1998-02-19 Brendan Kehoe + + * typeck.c (build_unary_op): Only warn about incr/decr a pointer + if pedantic || warn_pointer_arith. + Thu Feb 19 09:37:21 1998 Kriang Lerdsuwanakij * pt.c (unify): Handle TEMPLATE_DECL. diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index f1689a8688b..851020f99af 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -4341,8 +4341,9 @@ build_unary_op (code, xarg, noconvert) ((code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR) ? "increment" : "decrement"), TREE_TYPE (argtype)); - else if (tmp == FUNCTION_TYPE || tmp == METHOD_TYPE - || tmp == VOID_TYPE || tmp == OFFSET_TYPE) + else if ((pedantic || warn_pointer_arith) + && (tmp == FUNCTION_TYPE || tmp == METHOD_TYPE + || tmp == VOID_TYPE || tmp == OFFSET_TYPE)) cp_pedwarn ("ANSI C++ forbids %sing a pointer of type `%T'", ((code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR)