This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug other/80062] New: gcc/c-family/c-cppbuiltin.c: PVS-Studio: V581


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");
    ....
  }
....
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]