[systemd-commits] fixme src/sd-daemon.h

Lennart Poettering lennart at kemper.freedesktop.org
Thu Jun 17 14:26:27 PDT 2010


 fixme           |    2 --
 src/sd-daemon.h |    8 +++++++-
 2 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 706243a2d250a53fadf3a0e5ab85d458a79e50c8
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Jun 17 23:26:20 2010 +0200

    sd-daemon: add gcc format string attribute to sd_notifyf

diff --git a/fixme b/fixme
index 055fac4..1f42b7b 100644
--- a/fixme
+++ b/fixme
@@ -69,8 +69,6 @@
 
 * docdir für sd-daemon.[ch]
 
-* __attribute__ for sd_notifyf
-
 * convenience library
 
 Regularly:
diff --git a/src/sd-daemon.h b/src/sd-daemon.h
index 2d79082..20c260c 100644
--- a/src/sd-daemon.h
+++ b/src/sd-daemon.h
@@ -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
 }


More information about the systemd-commits mailing list