projects
/
argpar.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add format attributes to functions with format strings
[argpar.git]
/
argpar
/
argpar.c
diff --git
a/argpar/argpar.c
b/argpar/argpar.c
index b8b7c6307d82ead3741bffe4bfc003282981aee3..13f66812894037b669924eb4446fd3f5472e464b 100644
(file)
--- a/
argpar/argpar.c
+++ b/
argpar/argpar.c
@@
-35,7
+35,13
@@
#define ARGPAR_ASSERT(_cond) assert(_cond)
#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;
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;
char *argpar_asprintf(const char *fmt, ...)
{
va_list args;
@@
-78,7
+84,7
@@
char *argpar_asprintf(const char *fmt, ...)
return str;
}
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;
bool argpar_string_append_printf(char **str, const char *fmt, ...)
{
char *new_str = NULL;
This page took
0.022721 seconds
and
4
git commands to generate.