This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51755] New: -Wconversion generates false warnings when the ternary operator is used
- From: "james.kanze at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 04 Jan 2012 18:54:20 +0000
- Subject: [Bug c++/51755] New: -Wconversion generates false warnings when the ternary operator is used
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51755
Bug #: 51755
Summary: -Wconversion generates false warnings when the ternary
operator is used
Classification: Unclassified
Product: gcc
Version: 4.4.2
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: james.kanze@gmail.com
This might be covered by 40752; it's related. But if -Wconversion is used,
simple code like the following
int main()
{
static uint8_t const k = 0x02;
bool c = true;
uint8_t x = 0;
x |= c ? k : 0;
}
triggers a warning, although there is absolutely no possibility of overflow.