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/66454] New: Common -Wmisleading-indentation false-positive triggered in the Linux kernel


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

            Bug ID: 66454
           Summary: Common -Wmisleading-indentation false-positive
                    triggered in the Linux kernel
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: patrick at parcs dot ath.cx
  Target Milestone: ---

The following test case is a template exhibiting the kind of code in the Linux
kernel that often triggers a -Wmisleading-indentation false-positive:

  int *p;

  void
  foo (int n)
  {
      if (p) {
        foo (1);
      } else
      if (p)
        foo (2);
      foo (3);
  }

indentation.c: In function âfooâ:
indentation.c:13:5: warning: statement is indented as if it were guarded by...
[-Wmisleading-indentation]
     foo (3);
     ^
indentation.c:10:7: note: ...this âelseâ clause, but it is not
     } else
       ^

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