From 44d90fe1c00fa4bf947716cbfecf945892f182a6 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 24 Apr 2013 16:35:17 +0000 Subject: c.opt ([Wpointer-arith]): Enabled by -Wpedantic, as documented. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /c-family 2013-04-24 Paolo Carlini Manuel Lopez-Ibanez * c.opt ([Wpointer-arith]): Enabled by -Wpedantic, as documented. * c-common.c (pointer_int_sum): Change -Wpointer-arith pedwarns to simply use OPT_Wpointer_arith. (c_sizeof_or_alignof_type): Likewise. /cp 2013-04-24 Paolo Carlini * typeck.c (cxx_sizeof_or_alignof_type): Change -Wpointer-arith pedwarn to simply use OPT_Wpointer_arith. (cp_build_unary_op): Likewise. /c 2013-04-24 Paolo Carlini * c-typeck.c (pointer_diff): Change -Wpointer-arith pedwarns to simply use OPT_Wpointer_arith. (build_unary_op): Likewise. /testsuite 2013-04-24 Paolo Carlini * c-c++-common/Wpointer-arith-1.c: New. Co-Authored-By: Manuel López-Ibáñez From-SVN: r198256 --- gcc/c/ChangeLog | 6 ++++++ gcc/c/c-typeck.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'gcc/c') diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 771a557..cdcd416 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,9 @@ +2013-04-24 Paolo Carlini + + * c-typeck.c (pointer_diff): Change -Wpointer-arith pedwarns + to simply use OPT_Wpointer_arith. + (build_unary_op): Likewise. + 2013-04-03 Jakub Jelinek PR c/19449 diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index ddb6d39..5a29f7c 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -3333,10 +3333,10 @@ pointer_diff (location_t loc, tree op0, tree op1) if (TREE_CODE (target_type) == VOID_TYPE) - pedwarn (loc, pedantic ? OPT_Wpedantic : OPT_Wpointer_arith, + pedwarn (loc, OPT_Wpointer_arith, "pointer of type % used in subtraction"); if (TREE_CODE (target_type) == FUNCTION_TYPE) - pedwarn (loc, pedantic ? OPT_Wpedantic : OPT_Wpointer_arith, + pedwarn (loc, OPT_Wpointer_arith, "pointer to a function used in subtraction"); /* If the conversion to ptrdiff_type does anything like widening or @@ -3663,10 +3663,10 @@ build_unary_op (location_t location, || TREE_CODE (TREE_TYPE (argtype)) == VOID_TYPE) { if (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR) - pedwarn (location, pedantic ? OPT_Wpedantic : OPT_Wpointer_arith, + pedwarn (location, OPT_Wpointer_arith, "wrong type argument to increment"); else - pedwarn (location, pedantic ? OPT_Wpedantic : OPT_Wpointer_arith, + pedwarn (location, OPT_Wpointer_arith, "wrong type argument to decrement"); } -- cgit v1.1