From 9d7f696c2cfe5521a1201beb76326c8a34b4dbb5 Mon Sep 17 00:00:00 2001 From: Hiroshi Inoue Date: Wed, 30 Aug 2017 17:00:35 +0900 Subject: [PATCH] Add __attribute__((format(printf,3,4))) to the declaration of snprintfcat(). --- misc.h | 2 +- psqlodbc.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/misc.h b/misc.h index dda2758..81c18ef 100644 --- a/misc.h +++ b/misc.h @@ -22,7 +22,7 @@ char *strncpy_null(char *dst, const char *src, ssize_t len); #ifndef HAVE_STRLCAT size_t strlcat(char *, const char *, size_t); #endif /* HAVE_STRLCAT */ -int snprintfcat(char *buf, size_t size, const char *format, ...); +int snprintfcat(char *buf, size_t size, const char *format, ...) __attribute__((format(printf,3,4))); size_t snprintf_len(char *buf, size_t size, const char *format, ...); char *my_trim(char *string); diff --git a/psqlodbc.h b/psqlodbc.h index 7b6452e..b91969d 100644 --- a/psqlodbc.h +++ b/psqlodbc.h @@ -41,6 +41,10 @@ #include #endif /* WIN32 */ +#ifndef __GNUC__ +#define __attribute__(x) +#endif /* __GNUC__ */ + #ifdef _MEMORY_DEBUG_ void *pgdebug_alloc(size_t); void *pgdebug_calloc(size_t, size_t); -- 2.39.5