[Bug c++/51755] New: -Wconversion generates false warnings when the ternary operator is used
james.kanze at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Jan 4 18:54:00 GMT 2012
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.
More information about the Gcc-bugs
mailing list