This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/81577] New: -ftrack-macro-expansion=0 causes spurious “this ‘else’ clause does not guard” with -Wall
- From: "fw at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 27 Jul 2017 08:04:05 +0000
- Subject: [Bug c/81577] New: -ftrack-macro-expansion=0 causes spurious “this ‘else’ clause does not guard” with -Wall
- Auto-submitted: auto-generated
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).