[Bug c/49396] New: c-family/c-cppbuiltin.c: duplicate if expressions
dcb314 at hotmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Jun 13 20:20:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49396
Summary: c-family/c-cppbuiltin.c: duplicate if expressions
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: dcb314@hotmail.com
I just ran the static analysis tool cppcheck-1.49 over the source code
of snapshot 20110611 on a Fedora Linux x86_64 box.
The tool said
[gcc/c-family/c-cppbuiltin.c:562] -> [gcc/c-family/c-cppbuiltin.c:557]: (style)
Found duplicate if expressions.
The source code is
if (!prev->x_flag_finite_math_only && cur->x_flag_finite_math_only)
{
cpp_undef (pfile, "__FINITE_MATH_ONLY__");
cpp_define (pfile, "__FINITE_MATH_ONLY__=1");
}
else if (!prev->x_flag_finite_math_only && cur->x_flag_finite_math_only)
I agree with the tool. This looks like a possible cut'n'paste error.
Suggest code rework.
More information about the Gcc-bugs
mailing list