Submitter | Antonio Ospite |
---|---|
Date | 2018-02-27 22:13:58 |
Message ID | <20180227231358.0fbc9f9d3a544f01133c0195@ao2.it> |
Download | mbox | patch |
Permalink | /patch/4522/ |
State | New |
Headers | show |
Comments
> diff --git a/flash.h b/flash.h > index a80a9c2..40a7f1a 100644 > --- a/flash.h > +++ b/flash.h > @@ -360,6 +360,9 @@ int flashrom_print_cb(enum flashrom_log_level level, const char *fmt, va_list ap > /* Let gcc and clang check for correct printf-style format strings. */ > int print(enum flashrom_log_level level, const char *fmt, ...) > #ifdef __MINGW32__ > +# ifndef __MINGW_PRINTF_FORMAT > +# define __MINGW_PRINTF_FORMAT gnu_printf > +# endif > __attribute__((format(__MINGW_PRINTF_FORMAT, 2, 3))); > #else > __attribute__((format(printf, 2, 3))); > > > This should be OK because the define is only applied when using MinGW. > > JFYI I decided for a less backward compatible solution in the other > project: > https://git.ao2.it/libam7xxx.git/commitdiff/bbebd199987581ee6f344c89bfb02237dc0ab0bd > > Ciao, > Antonio This method compiles without warnings. Thank you very much! Are you planning to submit a patch to flashrom, or should we handle that? Best regards, Miklos Marton
On Wed, 28 Feb 2018 20:31:13 +0100 Miklos Marton <martonmiklosqdev@gmail.com> wrote: > > diff --git a/flash.h b/flash.h > > index a80a9c2..40a7f1a 100644 > > --- a/flash.h > > +++ b/flash.h > > @@ -360,6 +360,9 @@ int flashrom_print_cb(enum flashrom_log_level level, const char *fmt, va_list ap > > /* Let gcc and clang check for correct printf-style format strings. */ > > int print(enum flashrom_log_level level, const char *fmt, ...) > > #ifdef __MINGW32__ > > +# ifndef __MINGW_PRINTF_FORMAT > > +# define __MINGW_PRINTF_FORMAT gnu_printf > > +# endif > > __attribute__((format(__MINGW_PRINTF_FORMAT, 2, 3))); > > #else > > __attribute__((format(printf, 2, 3))); > > > > > > This should be OK because the define is only applied when using MinGW. > > [...] > This method compiles without warnings. Thank you very much! > Are you planning to submit a patch to flashrom, or should we handle that? > I can do it during the week-end. Ciao, Antonio
Patch
diff --git a/flash.h b/flash.h index a80a9c2..40a7f1a 100644 --- a/flash.h +++ b/flash.h @@ -360,6 +360,9 @@ int flashrom_print_cb(enum flashrom_log_level level, const char *fmt, va_list ap /* Let gcc and clang check for correct printf-style format strings. */ int print(enum flashrom_log_level level, const char *fmt, ...) #ifdef __MINGW32__ +# ifndef __MINGW_PRINTF_FORMAT +# define __MINGW_PRINTF_FORMAT gnu_printf +# endif __attribute__((format(__MINGW_PRINTF_FORMAT, 2, 3))); #else __attribute__((format(printf, 2, 3)));