[Asterisk-code-review] Clang: Fix some more tautological-compare warnings. (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Mon Apr 20 16:44:41 CDT 2015


Richard Mudgett has posted comments on this change.

Change subject: Clang: Fix some more tautological-compare warnings.
......................................................................


Patch Set 4:

(1 comment)

https://gerrit.asterisk.org/#/c/160/4/main/security_events.c
File main/security_events.c:

Line 424: 	RAII_VAR(struct ast_str *, str, NULL, ast_free);
        : 	struct ast_json *event_type_json;
        : 	enum ast_security_event_type event_type;
        : 
        : 	event_type_json = ast_json_object_get(json, "SecurityEvent");
        : 	event_type = ast_json_integer_get(event_type_json);
        : 
        : 	ast_assert(event_type < AST_SECURITY_EVENT_NUM_TYPES);
> Unless Clang also has some sort of compiler warning/error to prevent assign
Its not that silly.  If an enum is defined with *no* negative values a variable of that enum type can therefore never be negative.


-- 
To view, visit https://gerrit.asterisk.org/160
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ief23ef68916192b9b72dabe702b543ecfeca0b62
Gerrit-PatchSet: 4
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Diederik de Groot <dkgroot at talon.nl>
Gerrit-Reviewer: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list