This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/49396] New: c-family/c-cppbuiltin.c: duplicate if expressions
- From: "dcb314 at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 13 Jun 2011 20:20:33 +0000
- Subject: [Bug c/49396] New: c-family/c-cppbuiltin.c: duplicate if expressions
- Auto-submitted: auto-generated
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.