|
@@ -84,13 +84,19 @@
|
|
|
|
|
|
/* ===== Compiler compatibility */
|
|
/* ===== Compiler compatibility */
|
|
|
|
|
|
-/* GCC can check printf types on arbitrary functions. */
|
|
|
|
|
|
+/* GCC can check printf and scanf types on arbitrary functions. */
|
|
#ifdef __GNUC__
|
|
#ifdef __GNUC__
|
|
#define CHECK_PRINTF(formatIdx, firstArg) \
|
|
#define CHECK_PRINTF(formatIdx, firstArg) \
|
|
__attribute__ ((format(printf, formatIdx, firstArg)))
|
|
__attribute__ ((format(printf, formatIdx, firstArg)))
|
|
#else
|
|
#else
|
|
#define CHECK_PRINTF(formatIdx, firstArg)
|
|
#define CHECK_PRINTF(formatIdx, firstArg)
|
|
#endif
|
|
#endif
|
|
|
|
+#ifdef __GNUC__
|
|
|
|
+#define CHECK_SCANF(formatIdx, firstArg) \
|
|
|
|
+ __attribute__ ((format(scanf, formatIdx, firstArg)))
|
|
|
|
+#else
|
|
|
|
+#define CHECK_SCANF(formatIdx, firstArg)
|
|
|
|
+#endif
|
|
|
|
|
|
/* inline is __inline on windows. */
|
|
/* inline is __inline on windows. */
|
|
#ifdef _WIN32
|
|
#ifdef _WIN32
|