dmx: Add _X_ATTRIBUTE_PRINTF to dmxConfigLog() & dmxConfigOutput()
Gets rid of gcc 4.8 warnings: dmxparse.c: In function ‘dmxConfigLog’: dmxparse.c:61:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format] vprintf(format, args); /* RATS: All calls to dmxConfigLog from ^ dmxprint.c: In function ‘dmxConfigOutput’: dmxprint.c:149:9: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format] pos += vfprintf(str, format, args); /* assumes no newlines! */ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Rémi Cardona <remi@gentoo.org> Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
9e002dfcd7
commit
5e01eac10e
|
@ -38,6 +38,7 @@
|
||||||
#define _DMXPARSE_H_
|
#define _DMXPARSE_H_
|
||||||
|
|
||||||
#include <stdio.h> /* For FILE */
|
#include <stdio.h> /* For FILE */
|
||||||
|
#include <X11/Xfuncproto.h> /* For _X_ATTRIBUTE_PRINTF */
|
||||||
|
|
||||||
/** Stores tokens not stored in other structures (e.g., keywords and ;) */
|
/** Stores tokens not stored in other structures (e.g., keywords and ;) */
|
||||||
typedef struct _DMXConfigToken {
|
typedef struct _DMXConfigToken {
|
||||||
|
@ -203,7 +204,7 @@ extern int yylex(void);
|
||||||
extern int yydebug;
|
extern int yydebug;
|
||||||
extern void yyerror(const char *message);
|
extern void yyerror(const char *message);
|
||||||
|
|
||||||
extern void dmxConfigLog(const char *format, ...);
|
extern void dmxConfigLog(const char *format, ...) _X_ATTRIBUTE_PRINTF(1,0);
|
||||||
extern void *dmxConfigAlloc(unsigned long bytes);
|
extern void *dmxConfigAlloc(unsigned long bytes);
|
||||||
extern void *dmxConfigRealloc(void *orig,
|
extern void *dmxConfigRealloc(void *orig,
|
||||||
unsigned long orig_bytes, unsigned long bytes);
|
unsigned long orig_bytes, unsigned long bytes);
|
||||||
|
|
|
@ -130,7 +130,7 @@ dmxConfigPopState(void)
|
||||||
dmxConfigNewline();
|
dmxConfigNewline();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void _X_ATTRIBUTE_PRINTF(4, 5)
|
||||||
dmxConfigOutput(int addSpace, int doNewline, const char *comment,
|
dmxConfigOutput(int addSpace, int doNewline, const char *comment,
|
||||||
const char *format, ...)
|
const char *format, ...)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue