]> granicus.if.org Git - nethack/commit
makedefs lint
authorPatR <rankin@nethack.org>
Tue, 29 Mar 2016 00:23:00 +0000 (17:23 -0700)
committerPatR <rankin@nethack.org>
Tue, 29 Mar 2016 00:23:00 +0000 (17:23 -0700)
commit9e0a9d96f97783c719e9d3db3b20090e6abc2a93
tree8d2bd92959501df46d3074586764af0af68dfaa9
parentf81543aa4fc40834d66fc85a43dcb473546124df
makedefs lint

The Makefile race condition report included a link to a log file
of the build attempt, and it contained this:

makedefs.c: In function 'do_grep_control':
makedefs.c:611:26: warning: suggest parentheses around operand of '!'
 or change '|' to '||' or '!' to '~' [-Wparentheses]
 #define ST_LD(old, opp) (!!(old) | (!!(opp) << 1))
                          ^
makedefs.c:722:37: note: in expansion of macro 'ST_LD'
 grep_stack[++grep_sp] = ST_LD(grep_writing, !isif);
                         ^
They're using a more recent version of gcc than I am, because my
CFLAGS includes -Wparentheses (via -Wall) and I don't get that.

It's a little confusing, but I think it's whining that we might
have meant   !!((old) | (!!(opp) << 1))
rather than  (!!(old)) | (!!(opp) << 1).
The latter is what we get (and what we intended--no bug here).

I changed it to something that more directly reflects the intent
since it's not bit twiddling within some crucial innermost loop.
util/makedefs.c