OSDN Git Service

gcc/
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 9 Aug 2009 18:38:04 +0000 (18:38 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 9 Aug 2009 18:38:04 +0000 (18:38 +0000)
commit672d914b6dc4a0fc7889a877bfbace81ab852491
tree4f384af8342874e6f72150b4b11a160bb03fa4be
parente81447c7adc2b9a581985b9c0544821357f628cf
gcc/
* c-common.c (c_fully_fold_internal): Issue a warning if a binary
operation overflows.  Likewise non-cast unary arithmetic.
If one arm of a conditional expression is always taken,
inhibit evaluation warnings for the other arm.  Likewise inhibit
evaluation warnings for the second && or || operand if the first
operand is enough to determine the result.
* c-typeck.c (build_conditional_expr): Apply the same inhibition
rules here.
(build_binary_op): Prevent duplicate evaluation warnings.

gcc/testsuite/
* gcc.dg/overflow-warn-8.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150594 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/c-common.c
gcc/c-typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/overflow-warn-8.c [new file with mode: 0644]