configure: enable -Wsuggest-attribute=format
[babeltrace.git] / src / argpar / argpar.c
index ad56838fad853f15629a06f25dcec82b91d07d85..5bd2652e00bd195f386c75c10bf339f996a52325 100644 (file)
 
 #define ARGPAR_ASSERT(_cond) assert(_cond)
 
-static
+#ifdef __MINGW_PRINTF_FORMAT
+# define ARGPAR_PRINTF_FORMAT __MINGW_PRINTF_FORMAT
+#else
+# define ARGPAR_PRINTF_FORMAT printf
+#endif
+
+static __attribute__((format(ARGPAR_PRINTF_FORMAT, 1, 0)))
 char *argpar_vasprintf(const char *fmt, va_list args)
 {
        int len1, len2;
@@ -65,7 +71,7 @@ end:
 }
 
 
-static
+static __attribute__((format(ARGPAR_PRINTF_FORMAT, 1, 2)))
 char *argpar_asprintf(const char *fmt, ...)
 {
        va_list args;
@@ -78,7 +84,7 @@ char *argpar_asprintf(const char *fmt, ...)
        return str;
 }
 
-static
+static __attribute__((format(ARGPAR_PRINTF_FORMAT, 2, 3)))
 bool argpar_string_append_printf(char **str, const char *fmt, ...)
 {
        char *new_str = NULL;
This page took 0.022949 seconds and 4 git commands to generate.