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 c/79164] New: -Wduplicated-branches and macros


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79164

            Bug ID: 79164
           Summary: -Wduplicated-branches and macros
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

-Wduplicated-branches doesn't warn on

#include <stddef.h>
int *
f (int i)
{
  if (i > 9)
    return NULL;
  else
    return NULL;
}

because at least one expression from both arms comes from a macro.  But in this
case we should apparently warn.  We'll have to compare the expressions
side-by-side and decide if they're the same even from the macro expansion point
of view.

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