This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PR30465 duplicated overflow warning


:ADDPATCH c/c++:

The current rationale for overflow warnings is that we don't emit a
warning for the result of an operator is any of their operands has
TREE_OVERFLOW set, since we assume that an overflow warning has
already been given. This has been implemented for unary and binary
operators, however, it hasn't been followed for the conversion
operator. Hence, PR 30465.

If the expression to be converted has TREE_OVERFLOW set, we don't care
about giving any other warnings for an overflow in conversion since
the expression has already overflowed and a warning should have been
given already for this expression.

Bootstrapped and regression tested with --enable-languages=all on
i686-pc-linux-gnu.

OK for mainline?

2007-01-18 Manuel Lopez-Ibanez <manu@gcc.gnu.org>

  PR other/30465
 * c-common.c (convert_and_check): Don't give warnings for conversion
if 'expr' already overflowed.

testsuite/

  PR other/30465
 * gcc.dg/multiple-overflow-warn-3.c: New.
 * g++.dg/warn/multiple-overflow-warn-3.C: New.

Attachment: multiple-overflow.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]