X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fsd-daemon.h;h=20c260c40dd764c19a8f36fed05d079520930a8c;hb=f9704703f35a281d9f8fa12018bd396b2be30d36;hp=2d79082aa3b37ff9590dcffc8294934450fe7392;hpb=08bfb8106b3a337ebf9a4bf3a8ddd2e494d18b48;p=elogind.git diff --git a/src/sd-daemon.h b/src/sd-daemon.h index 2d79082aa..20c260c40 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 }