]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: config: remove a warning with clang
authorWilly Tarreau <w@1wt.eu>
Tue, 29 Apr 2014 17:55:25 +0000 (19:55 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 29 Apr 2014 17:55:25 +0000 (19:55 +0200)
Commit fc6c032 ("MEDIUM: global: add support for CPU binding on Linux ("cpu-map")")
merged into 1.5-dev13 involves a useless test that clang reports as a warning. The
"low" variable cannot be negative here. Issue reported by Charles Carter.

src/cfgparse.c

index 6ac3ccccfad73835f03cb8f4a2158c4a583f9f1a..c4f092fa9fc0f2bd1428e9acbdd1c97b3e52c911 100644 (file)
@@ -1405,7 +1405,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm)
                                        high = swap;
                                }
 
-                               if (low < 0 || high >= sizeof(long) * 8) {
+                               if (high >= sizeof(long) * 8) {
                                        Alert("parsing [%s:%d]: %s supports CPU numbers from 0 to %d.\n",
                                              file, linenum, args[0], (int)(sizeof(long) * 8 - 1));
                                        err_code |= ERR_ALERT | ERR_FATAL;