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/hgap.h src/inc/hgap.h index 4af14b7..8dc1fe1 100644 --- src/inc/hgap.h +++ src/inc/hgap.h @@ -32,32 +32,37 @@ struct sqlConnection *hgFreeConn(struct sqlConnection **pConn); /* Put back connection for reuse. */ HGID hgIdQuery(struct sqlConnection *conn, char *query); /* Return first field of first table as HGID. 0 return ok. */ HGID hgRealIdQuery(struct sqlConnection *conn, char *query); /* Return first field of first table as HGID- abort if 0. */ struct sqlConnection *hgStartUpdate(); /* Get a connection for an update. (Starts allocating id's) */ -void hgEndUpdate(struct sqlConnection **pConn, char *comment, ...); +void hgEndUpdate(struct sqlConnection **pConn, char *comment, ...) /* Finish up connection with a printf format comment. */ +#if defined(__GNUC__) +__attribute__((format(printf, 2, 3))) +#endif +; + HGID hgNextId(); /* Get next unique id. (Should only be called after hgStartUpdate). */ FILE *hgCreateTabFile(char *tableName); /* Open a tab file with name corresponding to tableName. This * may just be fclosed when done. (Currently just makes * tableName.tab in the current directory.) */ void hgLoadTabFile(struct sqlConnection *conn, char *tableName); /* Load tab delimited file corresponding to tableName. * Should only be used after hgCreatTabFile, and only after * file closed. */