[PD-dev] fiddle~.c warning
Dan Wilcox
danomatika at gmail.com
Fri Apr 1 11:41:43 CEST 2016
Curious about a couple clang warnings for fiddle~.c:
pure-data/extra/fiddle~/fiddle~.c:1120:20: warning: comparison of constant 0 with boolean expression is always false [-Wtautological-constant-out-of-range-compare]
if (!npeakanal < 0) npeakanal = 0;
~~~~~~~~~~ ^ ~
pure-data/extra/fiddle~/fiddle~.c:1122:19: warning: comparison of constant 0 with boolean expression is always false [-Wtautological-constant-out-of-range-compare]
if (!npeakout < 0) npeakout = 0;
~~~~~~~~~ ^ ~
Since both npeakanal & npeakout are longs, the ! operator is basically checking if they are 0 right by converting to a bool. I follow that. I’m just not sure how a bool can be less than 0 and I guess clang isn’t either :)
--------
Dan Wilcox
@danomatika <https://twitter.com/danomatika>
danomatika.com <http://danomatika.com/>
robotcowboy.com <http://robotcowboy.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20160401/698b6bb2/attachment.html>
More information about the Pd-dev
mailing list