[PATCH] libosmocore[master]: control_cmd.c: Fix unsigned comparison against < 0

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Fri Jun 23 13:42:49 UTC 2017


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/3027

to look at the new patch set (#3).

control_cmd.c: Fix unsigned comparison against < 0

Fixes following warning:
control_cmd.c:294:16: warning: comparison of unsigned enum expression < 0 is always false [-Wtautological-compare]
        if (cmd->type < 0 || cmd->type == CTRL_TYPE_UNKNOWN) {

Change-Id: I3df8a4f646222337927d9e3cac6d09a8a05cb20c
---
M src/ctrl/control_cmd.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/27/3027/3

diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c
index 836bb71..24b388b 100644
--- a/src/ctrl/control_cmd.c
+++ b/src/ctrl/control_cmd.c
@@ -291,7 +291,7 @@
 	}
 
 	cmd->type = get_string_value(ctrl_type_vals, tmp);
-	if (cmd->type < 0 || cmd->type == CTRL_TYPE_UNKNOWN) {
+	if ((int)cmd->type < 0 || cmd->type == CTRL_TYPE_UNKNOWN) {
 		cmd->type = CTRL_TYPE_ERROR;
 		cmd->id = "err";
 		cmd->reply = "Request type unknown";

-- 
To view, visit https://gerrit.osmocom.org/3027
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I3df8a4f646222337927d9e3cac6d09a8a05cb20c
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list