Those are a bit less obvious than those I pushed directly to master.
All those changes were required to build LXC under clang here.
With this, gcc can be replaced by clang to build LXC so long as you're
not using the python3 binding (as python extensions can't be built under
clang at the moment).
For reference, the clang output for those is: http://paste.ubuntu.com/
6292460/
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
buf[n] = '\0';
result = strtol(buf, &ptr, 10);
if (!ptr || (*ptr != '\0' && *ptr != '\n') ||
- result == LONG_MIN || result == LONG_MAX)
+ result == INT_MIN || result == INT_MAX)
result = -1;
}
[LXC_CMD_GET_CONFIG_ITEM] = "get_config_item",
};
- if (cmd < 0 || cmd >= LXC_CMD_MAX)
+ if (cmd >= LXC_CMD_MAX)
return "Unknown cmd";
return cmdname[cmd];
}
[LXC_CMD_GET_CONFIG_ITEM] = lxc_cmd_get_config_item_callback,
};
- if (req->cmd < 0 || req->cmd >= LXC_CMD_MAX) {
+ if (req->cmd >= LXC_CMD_MAX) {
ERROR("bad cmd %d received", req->cmd);
return -1;
}
* we don't */
capid = strtol(drop_entry, &ptr, 10);
if (!ptr || *ptr != '\0' ||
- capid == LONG_MIN || capid == LONG_MAX)
+ capid == INT_MIN || capid == INT_MAX)
/* not a valid number */
capid = -1;
else if (capid > lxc_caps_last_cap())
* we don't */
capid = strtol(keep_entry, &ptr, 10);
if (!ptr || *ptr != '\0' ||
- capid == LONG_MIN || capid == LONG_MAX)
+ capid == INT_MIN || capid == INT_MAX)
/* not a valid number */
capid = -1;
else if (capid > lxc_caps_last_cap())