chiark / gitweb /
sd-daemon: add gcc format string attribute to sd_notifyf
authorLennart Poettering <lennart@poettering.net>
Thu, 17 Jun 2010 21:26:20 +0000 (23:26 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 17 Jun 2010 21:26:20 +0000 (23:26 +0200)
fixme
src/sd-daemon.h

diff --git a/fixme b/fixme
index 055fac488d425c4cae9ec2f78800f6bc4c9eb85a..1f42b7b7b1e89d8ccff193bcc794e9d4b99b737d 100644 (file)
--- a/fixme
+++ b/fixme
@@ -69,8 +69,6 @@
 
 * docdir für sd-daemon.[ch]
 
-* __attribute__ for sd_notifyf
-
 * convenience library
 
 Regularly:
index 2d79082aa3b37ff9590dcffc8294934450fe7392..20c260c40dd764c19a8f36fed05d079520930a8c 100644 (file)
@@ -41,6 +41,12 @@ extern "C" {
  * algorithms described here, if they do not want to include these two
  * source files. */
 
+#ifdef __GNUC__
+#define _sd_printf_attr_(a,b) __attribute__ ((format (printf, a, b)))
+#else
+#define _sd_printf_attr_(a,b)
+#endif
+
 /*
   Log levels for usage on stderr:
 
@@ -170,7 +176,7 @@ int sd_notify(int unset_environment, const char *state);
  *               strerror(errno),
  *               errno);
  */
-int sd_notifyf(int unset_environment, const char *format, ...);
+int sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_attr_(2,3);
 
 #ifdef __cplusplus
 }