diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2013-04-24 16:35:17 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2013-04-24 16:35:17 +0000 |
commit | 44d90fe1c00fa4bf947716cbfecf945892f182a6 (patch) | |
tree | 5e50f567107a826356fa5426fbedd18bebb7acde /gcc/c | |
parent | f6ce35ac7cd0498638a00396ae4a47269def92ac (diff) | |
download | gcc-44d90fe1c00fa4bf947716cbfecf945892f182a6.zip gcc-44d90fe1c00fa4bf947716cbfecf945892f182a6.tar.gz gcc-44d90fe1c00fa4bf947716cbfecf945892f182a6.tar.bz2 |
c.opt ([Wpointer-arith]): Enabled by -Wpedantic, as documented.
/c-family
2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* 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 <paolo.carlini@oracle.com>
* 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 <paolo.carlini@oracle.com>
* 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 <paolo.carlini@oracle.com>
* c-c++-common/Wpointer-arith-1.c: New.
Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org>
From-SVN: r198256
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c/c-typeck.c | 8 |
2 files changed, 10 insertions, 4 deletions
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 <paolo.carlini@oracle.com> + + * c-typeck.c (pointer_diff): Change -Wpointer-arith pedwarns + to simply use OPT_Wpointer_arith. + (build_unary_op): Likewise. + 2013-04-03 Jakub Jelinek <jakub@redhat.com> 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 %<void *%> 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"); } |