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/hg/hgTracks/hgTracks.h src/hg/hgTracks/hgTracks.h index eda34aa..333eb74 100644 --- src/hg/hgTracks/hgTracks.h +++ src/hg/hgTracks/hgTracks.h @@ -514,33 +514,37 @@ /* Print out image map rectangle that would invoke this program again * at a different window. */ void mapBoxHgcOrHgGene(struct hvGfx *hvg, int start, int end, int x, int y, int width, int height, char *track, char *item, char *statusLine, char *directUrl, boolean withHguid, char *extra); /* Print out image map rectangle that would invoke the hgc (human genome click) * program. */ void genericMapItem(struct track *tg, struct hvGfx *hvg, void *item, char *itemName, char *mapItemName, int start, int end, int x, int y, int width, int height); /* This is meant to be used by genericDrawItems to set to tg->mapItem in */ /* case tg->mapItem isn't set to anything already. */ -void mapStatusMessage(char *format, ...); +void mapStatusMessage(char *format, ...) /* Write out stuff that will cause a status message to * appear when the mouse is over this box. */ +#if defined(__GNUC__) +__attribute__((format(printf, 1, 2))) +#endif +; double scaleForWindow(double width, int seqStart, int seqEnd); /* Return the scale for the window. */ double scaleForPixels(double pixelWidth); /* Return what you need to multiply bases by to * get to scale of pixel coordinates. */ void drawScaledBox(struct hvGfx *hvg, int chromStart, int chromEnd, double scale, int xOff, int y, int height, Color color); /* Draw a box scaled from chromosome to window coordinates. * Get scale first with scaleForPixels. */ void drawScaledBoxBlend(struct hvGfx *hvg, int chromStart, int chromEnd, double scale, int xOff, int y, int height, Color color);