src/lib/options.c 1.27
1.27 2009/09/23 18:42:28 angie
Fixed compiler warnings from gcc 4.3.3, mostly about system calls whose return values weren't checked and non-literal format strings with no args.
Index: src/lib/options.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/lib/options.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -b -B -U 4 -r1.26 -r1.27
--- src/lib/options.c 13 Aug 2009 21:48:17 -0000 1.26
+++ src/lib/options.c 23 Sep 2009 18:42:28 -0000 1.27
@@ -48,8 +48,9 @@
optionSpec = matchingOption(name, commonOptions);
if (optionSpec == NULL)
errAbort("-%s is not a valid option", name);
+long long discardMe = 0;
switch (optionSpec->flags & OPTION_TYPE_MASK) {
case OPTION_BOOLEAN:
if (val != NULL)
errAbort("boolean option -%s must not have value", name);
@@ -60,33 +61,33 @@
break;
case OPTION_INT:
if (val == NULL)
errAbort("int option -%s must have a value", name);
- strtol(val, &valEnd, 10);
+ discardMe = strtol(val, &valEnd, 10);
if ((*val == '\0') || (*valEnd != '\0'))
errAbort("value of -%s is not a valid integer: \"%s\"",
name, val);
break;
case OPTION_LONG_LONG:
if (val == NULL)
errAbort("int option -%s must have a value", name);
- strtoll(val, &valEnd, 10);
+ discardMe = strtoll(val, &valEnd, 10);
if ((*val == '\0') || (*valEnd != '\0'))
errAbort("value of -%s is not a valid long long: \"%s\"",
name, val);
break;
case OPTION_FLOAT:
if (val == NULL)
errAbort("float option -%s must have a value", name);
- strtod(val, &valEnd);
+ discardMe = (long long)strtod(val, &valEnd);
if ((*val == '\0') || (*valEnd != '\0'))
errAbort("value of -%s is not a valid float: \"%s\"",
name, val);
break;
case OPTION_DOUBLE:
if (val == NULL)
errAbort("double option -%s must have a value", name);
- strtod(val, &valEnd);
+ discardMe = (long long)strtod(val, &valEnd);
if ((*val == '\0') || (*valEnd != '\0'))
errAbort("value of -%s is not a valid double: \"%s\"",
name, val);
break;