gperf -- #define for if (0) ; else for

Sean Bruno sean_bruno at yahoo.com
Mon Oct 21 03:58:01 UTC 2013


I don't even know why this is a thing in our code base.  Its generating
a lot of clang noise due to -Wdangling-else

/usr/src/gnu/usr.bin/gperf/../../../contrib/gperf/src/search.cc:417:15:
warning: add explicit braces to avoid dangling else [-Wdangling-else]
              for (int i3 = imax; i3 >= 0; i3--)
              ^
/usr/src/gnu/usr.bin/gperf/../../../contrib/gperf/src/search.cc:39:22:
note: expanded from macro 'for'
#define for if (0) ; else for
                     ^

I see no reason to continue this and propose the removal of the line in
contrib/gperf/src/search.cc 

     37
     38 /* Assume ISO C++ 'for' scoping rule.  */
     39 #define for if (0) ; else for


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20131020/6ee6fb1f/attachment.sig>


More information about the freebsd-hackers mailing list