[
https://issues.apache.org/jira/browse/TS-2341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13820295#comment-13820295
]
ASF subversion and git services commented on TS-2341:
-----------------------------------------------------
Commit 8c635a6e05e607d227cc061715e2acbeb594bde6 in branch refs/heads/master
from [~psudaemon]
[ https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;h=8c635a6 ]
TS-2341: Cast TSHttpStatus to int to suppress compiler warning in clang
Because TSHttpStatus is an enum and has a max value less than 599, comparing
<= of a variable of that type with a constant of that magnitude will always
return true. Casting to int removes that guarantee and thus the warning.
> remap_stats: comparsion always true warning
> -------------------------------------------
>
> Key: TS-2341
> URL: https://issues.apache.org/jira/browse/TS-2341
> Project: Traffic Server
> Issue Type: Bug
> Components: Plugins
> Affects Versions: 4.1.0
> Reporter: Thomas Berger
> Assignee: Phil Sorber
> Priority: Trivial
> Fix For: 4.2.0
>
>
> clang throws a warning while compiling the remap_stats plugin:
> {noformat}
> plugins/experimental/remap_stats/remap_stats.c:230:63: warning: comparison of
> constant 599 with expression of type 'TSHttpStatus' is always true
> [-Wtautological-constant-out-of-range-compare]
> else if ((status_code >= 500) && (status_code <= 599))
> ~~~~~~~~~~~ ^ ~~~
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.1#6144)