Skip to content

Commit

Permalink
Fix warnings under MinGW and Clang
Browse files Browse the repository at this point in the history
Use the 'printf' format on all GNU compilers, which includes the
MinGW-flavoured GCC and Clang (which is not GNU, but says it is).

Signed-off-by: Paul Cercueil <[email protected]>
  • Loading branch information
pcercuei committed Apr 23, 2021
1 parent 7e07fe6 commit b74bc25
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions iio-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@
#define iio_sscanf sscanf
#endif

#if defined(__MINGW32__)
# define __iio_printf __attribute__((__format__(ms_printf, 3, 4)))
#elif defined(__GNUC__)
# define __iio_printf __attribute__((__format__(gnu_printf, 3, 4)))
#if defined(__GNUC__)
# define __iio_printf __attribute__((__format__(printf, 3, 4)))
#else
# define __iio_printf
#endif
Expand Down

0 comments on commit b74bc25

Please sign in to comment.