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

            Bug ID: 81577
           Summary: -ftrack-macro-expansion=0 causes spurious “this ‘else’
                    clause does not guard” with -Wall
           Product: gcc
           Version: 6.3.1
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fw at gcc dot gnu.org
  Target Milestone: ---

Created attachment 41844
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41844&action=edit
poc.c

Reported downstream by Lukas Slebodnik.

The reproducer has to be compiled with -O2 -Wall -ftrack-macro-expansion=0:

poc.c: In function ‘main’:
poc.c:13:5: warning: this ‘else’ clause does not guard...
[-Wmisleading-indentation]
     SOME_MACRO(htons(16), uint16_t);
     ^~~~~~~~~~
poc.c:13:5: note: ...this statement, but the latter is misleadingly indented as
if it were guarded by the ‘else’
poc.c:14:5: warning: this ‘else’ clause does not guard...
[-Wmisleading-indentation]
     SOME_MACRO(ntohs(16), uint16_t);
     ^~~~~~~~~~
poc.c:14:5: note: ...this statement, but the latter is misleadingly indented as
if it were guarded by the ‘else’

Still visible with gcc-7.1.1-3.fc26.x86_64, gcc (GCC) 7.1.1 20170622 (Red Hat
7.1.1-3).

Reply via email to