mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
Tweak __attribute__((format)) for MinGW.
This silences a bunch of spurious format warnings on a Ubuntu 14.04 mingw-w64 cross-compilation.
This commit is contained in:
parent
134dc0bcaf
commit
81be535f67
18
misc.h
18
misc.h
@ -24,11 +24,27 @@ char *host_strchr(const char *s, int c);
|
|||||||
char *host_strrchr(const char *s, int c);
|
char *host_strrchr(const char *s, int c);
|
||||||
char *host_strduptrim(const char *s);
|
char *host_strduptrim(const char *s);
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
/*
|
||||||
|
* On MinGW, the correct compiler format checking for vsnprintf() etc
|
||||||
|
* can depend on compile-time flags; these control whether you get
|
||||||
|
* ISO C or Microsoft's non-standard format strings.
|
||||||
|
* We sometimes use __attribute__ ((format)) for our own printf-like
|
||||||
|
* functions, which are ultimately interpreted by the toolchain-chosen
|
||||||
|
* printf, so we need to take that into account to get correct warnings.
|
||||||
|
*/
|
||||||
|
#ifdef __MINGW_PRINTF_FORMAT
|
||||||
|
#define PUTTY_PRINTF_ARCHETYPE __MINGW_PRINTF_FORMAT
|
||||||
|
#else
|
||||||
|
#define PUTTY_PRINTF_ARCHETYPE printf
|
||||||
|
#endif
|
||||||
|
#endif /* __GNUC__ */
|
||||||
|
|
||||||
char *dupstr(const char *s);
|
char *dupstr(const char *s);
|
||||||
char *dupcat(const char *s1, ...);
|
char *dupcat(const char *s1, ...);
|
||||||
char *dupprintf(const char *fmt, ...)
|
char *dupprintf(const char *fmt, ...)
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
__attribute__ ((format (printf, 1, 2)))
|
__attribute__ ((format (PUTTY_PRINTF_ARCHETYPE, 1, 2)))
|
||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
char *dupvprintf(const char *fmt, va_list ap);
|
char *dupvprintf(const char *fmt, va_list ap);
|
||||||
|
@ -131,7 +131,7 @@ void pageant_make_keylist2(BinarySink *bs)
|
|||||||
|
|
||||||
static void plog(void *logctx, pageant_logfn_t logfn, const char *fmt, ...)
|
static void plog(void *logctx, pageant_logfn_t logfn, const char *fmt, ...)
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
__attribute__ ((format (printf, 3, 4)))
|
__attribute__ ((format (PUTTY_PRINTF_ARCHETYPE, 3, 4)))
|
||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user