serf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lieven Govaerts (Jira)" <>
Subject [jira] [Commented] (SERF-196) compile warning / logic error (autological-overlap-compare) in buckets/deflate_buckets.c:207
Date Sun, 26 Jul 2020 20:44:00 GMT


Lieven Govaerts commented on SERF-196:

Thanks for the report. 


A quick look at the code learns me that the second part of the boolean expression will indeed
always evaluate to False, as {{STATE_COMPRESS_INIT and }}{{STATE_COMPRESS_FINISH are defined
as two consecutive constants in enum deflate_state_t, so their is no state between and STATE_COMPRESS_FINISH.}}{{}}


{{if ((ctx->state > STATE_INIT && ctx->state <= STATE_FINISH) ||}}

{{}}{{    (ctx->state > STATE_COMPRESS_INIT && ctx->state < STATE_COMPRESS_FINISH))}}


The code was altered by Bert in 2015 (rev. 1713932), but unfortunately it's not clear what
specific issue it was supposed to solve and if there is a unit test for the issue. 

Maybe Bert remembers?



> compile warning / logic error (autological-overlap-compare) in buckets/deflate_buckets.c:207
> --------------------------------------------------------------------------------------------
>                 Key: SERF-196
>                 URL:
>             Project: serf
>          Issue Type: Bug
>    Affects Versions: serf-1.4.0, serf-trunk
>         Environment: gcc --version
> Configured with: --prefix=/Applications/ --with-gxx-include-dir=/Applications/
> Apple clang version 12.0.0 (clang-1200.0.22.19)
> Target: arm64-apple-darwin20.0.0
> Thread model: posix
> InstalledDir: /Applications/
>            Reporter: AMD Dev
>            Priority: Major
>              Labels: newbie
> Maybe a logic error in buckets/deflate_buckets.c at line 207?
> It's running a beta copy of Apple MacOS 10.11 (Big Sur) on AMD hardware.  But I've compiled
100's of open source packages in the past few days, and it's the first time I've seen this,
so it's probably worth a closer look by someone more familiar with the code than I am.
> I've listed the priority as Major, because I'm not sure the impact on the code at execution.
 Theoretically the bug could be a higher or lower priority.
> {{scons: Building targets ...}}{{gcc -o buckets/deflate_buckets.o -c -std=c89 -Wdeclaration-after-statement
-I. -I/Users/ -I/Users/ -I/usr/include buckets/deflate_buckets.c}}{{buckets/deflate_buckets.c:207:13:
warning: overlapping comparisons always evaluate to false [-Wtautological-overlap-compare]}}{{ 
          && ctx->state < STATE_COMPRESS_FINISH))}}{{           

This message was sent by Atlassian Jira

View raw message