0999158088e0fb3715eb27703c8c4f7123d77144 galt Mon Sep 21 16:51:20 2015 -0700 added GNU-C attributes to function declarations in src/inc, src/hg/inc, and some CGIs so that the compiler can catch errors where the parameter list given by the user does not match their format string. These var-args functions are like printf. diff --git src/inc/sqlNum.h src/inc/sqlNum.h index 2c294ce..fc60bb4 100644 --- src/inc/sqlNum.h +++ src/inc/sqlNum.h @@ -10,32 +10,36 @@ * * This file is copyright 2002 Jim Kent, but license is hereby * granted for all use - public, private or commercial. */ #ifndef SQLNUM_H #define SQLNUM_H /* get off_t */ #include <sys/types.h> unsigned sqlUnsigned(char *s); /* Convert series of digits to unsigned integer about * twice as fast as atoi (by not having to skip white * space or stop except at the null byte.) */ -unsigned sqlUnsignedOrError(char *s, char *format, ...); +unsigned sqlUnsignedOrError(char *s, char *format, ...) /* like sqlUnsigned, with an optional error message as a printf-style vararg */ +#if defined(__GNUC__) +__attribute__((format(printf, 2, 3))) +#endif +; unsigned sqlUnsignedInList(char **pS); /* Convert series of digits to unsigned integer about * twice as fast as atoi (by not having to skip white * space or stop except at the null byte.) * All of string is number. Number may be delimited by a comma. * Returns the position of the delimiter or the terminating 0. */ unsigned long sqlUnsignedLong(char *s); /* Convert series of digits to unsigned long about * twice as fast as atol (by not having to skip white * space or stop except at the null byte.) */ unsigned long sqlUnsignedLongInList(char **pS); /* Convert series of digits to unsigned long about