[Scummvm-git-logs] scummvm master -> 1f6f82361f04e70fc5ba11efea34ff15a94afc10
bluegr
bluegr at gmail.com
Tue Mar 30 23:09:47 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
1f6f82361f COMMON: Use __gnu_printf__ instead of __printf__ for gcc on MinGW
Commit: 1f6f82361f04e70fc5ba11efea34ff15a94afc10
https://github.com/scummvm/scummvm/commit/1f6f82361f04e70fc5ba11efea34ff15a94afc10
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-03-31T02:09:45+03:00
Commit Message:
COMMON: Use __gnu_printf__ instead of __printf__ for gcc on MinGW
With __printf__, MinGW prefers the portable old ms-style printf, and
warns if formats like %lld and %hhd are used.
In practice, if __USE_MINGW_ANSI_STDIO is not defined, it defaults to 1
on C++11, and these formats are supported. Using __gnu_printf__
suppresses bad format warnings.
Changed paths:
common/scummsys.h
diff --git a/common/scummsys.h b/common/scummsys.h
index 19550a5930..79fb7a7791 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -339,7 +339,11 @@
//
#ifndef GCC_PRINTF
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
- #define GCC_PRINTF(x,y) __attribute__((__format__(__printf__, x, y)))
+ #if __USE_MINGW_ANSI_STDIO && !defined(__clang__)
+ #define GCC_PRINTF(x,y) __attribute__((__format__(__gnu_printf__, x, y)))
+ #else
+ #define GCC_PRINTF(x,y) __attribute__((__format__(__printf__, x, y)))
+ #endif
#else
#define GCC_PRINTF(x,y)
#endif
More information about the Scummvm-git-logs
mailing list