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/
These are certainly bugs :)
M
On Fri, Apr 01, 2016 at 03:41:43AM -0600, Dan Wilcox wrote:
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/
Pd-dev mailing list Pd-dev@lists.iem.at http://lists.puredata.info/listinfo/pd-dev
Here's to *some* compiler warnings :)
enohp ym morf tnes -------------- Dan Wilcox danomatika.com robotcowboy.com
On Apr 1, 2016, at 12:25 PM, Miller Puckette msp@ucsd.edu wrote:
These are certainly bugs :)
M
On Fri, Apr 01, 2016 at 03:41:43AM -0600, Dan Wilcox wrote:
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/
Pd-dev mailing list Pd-dev@lists.iem.at http://lists.puredata.info/listinfo/pd-dev