[asterisk-bugs] [JIRA] (ASTERISK-24917) clang compilation warnings
Diederik de Groot (JIRA)
noreply at issues.asterisk.org
Thu Mar 26 16:59:35 CDT 2015
[ https://issues.asterisk.org/jira/browse/ASTERISK-24917?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=225623#comment-225623 ]
Diederik de Groot commented on ASTERISK-24917:
----------------------------------------------
-Wtautological-compare: Comparing unsigned int > 0, which is always true.
https://reviewboard.asterisk.org/r/4533/
Note: This one shows a number of occasins where comparing and enum < 0 where the function which should have returned an enum is actually trying to convey an error state using -1.
Side Remark: It might be a good idea to create a generic way to convey such an error state in all enum2str and str2enum functions, either by extending the enum to include a SENTINEL / ERROR state, or by having such function also return and error state by reference. It might even be a good idea to implement three generic versions of enum2str/str2enum (one for bitfield oriented enums, one for sparse enums and one for regular ones, all using a similar format and able to return and error state (especially important for str2enum)).
> clang compilation warnings
> --------------------------
>
> Key: ASTERISK-24917
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-24917
> Project: Asterisk
> Issue Type: Improvement
> Security Level: None
> Components: Core/General
> Affects Versions: 11.17.0, 13.2.0
> Environment: clang
> Reporter: Diederik de Groot
>
> clang's static analyzer will throw quite a number warnings / errors during compilation, some of which can be very helpfull in finding corner-case bugs. Will use this issue report to group together a number of reviewboard entries.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list