|
@@ -25,6 +25,21 @@
|
|
|
|
|
|
/* global defines */
|
|
|
|
|
|
+
|
|
|
+/*
|
|
|
+ * Define the printf format specifier for all GCC versions > 3.3
|
|
|
+ * This will let the compiler know that shelmatta_printf() is a function taking printf-like format specifiers.
|
|
|
+ */
|
|
|
+#ifndef SHELLMATTA_ATTR_FORMAT
|
|
|
+# if ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)))
|
|
|
+# define SHELLMATTA_ATTR_FORMAT(fmt, args) __attribute__((__format__(__printf__, fmt, args)))
|
|
|
+# else
|
|
|
+# define SHELLMATTA_ATTR_FORMAT(fmt, args)
|
|
|
+# endif
|
|
|
+#else
|
|
|
+# define SHELLMATTA_ATTR_FORMAT(fmt, args)
|
|
|
+#endif
|
|
|
+
|
|
|
/**
|
|
|
* @brief definition of a shellmatta handle
|
|
|
*/
|
|
@@ -207,7 +222,8 @@ shellmatta_retCode_t shellmatta_opt_long( shellmatta_handle_t handle,
|
|
|
#ifndef SHELLMATTA_STRIP_PRINTF
|
|
|
shellmatta_retCode_t shellmatta_printf( shellmatta_handle_t handle,
|
|
|
const char *fmt,
|
|
|
- ...);
|
|
|
+ ...)
|
|
|
+ SHELLMATTA_ATTR_FORMAT(2, 3);
|
|
|
#endif
|
|
|
|
|
|
#endif
|