[PATCH 19/22] trace.h: use the FORMATPRINTF macro to declare the gcc function attribute 'format printf'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use the new FORMATPRINTF macro (in git-compat-util.h) to declare the gcc function
attribute 'format printf'

Signed-off-by: Elia Pinto <gitter.spiros@xxxxxxxxx>
---
 trace.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/trace.h b/trace.h
index 179b249..14df130 100644
--- a/trace.h
+++ b/trace.h
@@ -22,23 +22,23 @@ extern void trace_verbatim(struct trace_key *key, const void *buf, unsigned len)
 
 #ifndef HAVE_VARIADIC_MACROS
 
-__attribute__((format (printf, 1, 2)))
+FORMATPRINTF(1,2)
 extern void trace_printf(const char *format, ...);
 
-__attribute__((format (printf, 2, 3)))
+FORMATPRINTF(2,3)
 extern void trace_printf_key(struct trace_key *key, const char *format, ...);
 
-__attribute__((format (printf, 2, 3)))
+FORMATPRINTF(2,3)
 extern void trace_argv_printf(const char **argv, const char *format, ...);
 
 extern void trace_strbuf(struct trace_key *key, const struct strbuf *data);
 
 /* Prints elapsed time (in nanoseconds) if GIT_TRACE_PERFORMANCE is enabled. */
-__attribute__((format (printf, 2, 3)))
+FORMATPRINTF(2,3)
 extern void trace_performance(uint64_t nanos, const char *format, ...);
 
 /* Prints elapsed time since 'start' if GIT_TRACE_PERFORMANCE is enabled. */
-__attribute__((format (printf, 2, 3)))
+FORMATPRINTF(2,3)
 extern void trace_performance_since(uint64_t start, const char *format, ...);
 
 #else
@@ -97,15 +97,15 @@ extern void trace_performance_since(uint64_t start, const char *format, ...);
 			     __VA_ARGS__)
 
 /* backend functions, use non-*fl macros instead */
-__attribute__((format (printf, 4, 5)))
+FORMATPRINTF(4,5)
 extern void trace_printf_key_fl(const char *file, int line, struct trace_key *key,
 				const char *format, ...);
-__attribute__((format (printf, 4, 5)))
+FORMATPRINTF(4,5)
 extern void trace_argv_printf_fl(const char *file, int line, const char **argv,
 				 const char *format, ...);
 extern void trace_strbuf_fl(const char *file, int line, struct trace_key *key,
 			    const struct strbuf *data);
-__attribute__((format (printf, 4, 5)))
+FORMATPRINTF(4,5)
 extern void trace_performance_fl(const char *file, int line,
 				 uint64_t nanos, const char *fmt, ...);
 
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]