This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/80062] New: gcc/c-family/c-cppbuiltin.c: PVS-Studio: V581
- From: "khandeliants at viva64 dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 16 Mar 2017 06:48:27 +0000
- Subject: [Bug other/80062] New: gcc/c-family/c-cppbuiltin.c: PVS-Studio: V581
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80062
Bug ID: 80062
Summary: gcc/c-family/c-cppbuiltin.c: PVS-Studio: V581
Product: gcc
Version: 7.0.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
Assignee: unassigned at gcc dot gnu.org
Reporter: khandeliants at viva64 dot com
Target Milestone: ---
We have found a bug using PVS-Studio tool. PVS-Studio is a static code analyzer
for C, C++ and C#: https://www.viva64.com/en/pvs-studio/
Analyzer warning: V581 The conditional expressions of the 'if' operators
situated alongside each other are identical. Check lines: 920, 922.
c-cppbuiltin.c 922
void c_cpp_builtins (cpp_reader *pfile)
{
....
if (cxx_dialect >= cxx11)
{
if (cxx_dialect == cxx11)
cpp_define (pfile, "__cpp_constexpr=200704");
if (cxx_dialect <= cxx14) // <=
cpp_define (pfile, "__cpp_range_based_for=200907");
if (cxx_dialect <= cxx14) // <=
cpp_define (pfile, "__cpp_static_assert=200410");
....
}
....
}