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: [email protected]
ReportedBy: [email protected]
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.