---
 st.c | 4 ++--
 st.h | 5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/st.c b/st.c
index 72f447a..236c92b 100644
--- a/st.c
+++ b/st.c
@@ -670,7 +670,7 @@ selclear(void)
        tsetdirt(sel.nb.y, sel.ne.y);
 }
 
-void
+void PRINTF
 die(const char *errstr, ...)
 {
        va_list ap;
@@ -733,7 +733,7 @@ sigchld(UNUSED int a)
        pid_t p;
 
        if ((p = waitpid(pid, &stat, WNOHANG)) < 0)
-               die("waiting for pid %hd failed: %s\n", pid, strerror(errno));
+               die("waiting for pid %jd failed: %s\n", (intmax_t)pid, 
strerror(errno));
 
        if (pid != p)
                return;
diff --git a/st.h b/st.h
index 59f1d6e..506926f 100644
--- a/st.h
+++ b/st.h
@@ -28,6 +28,11 @@
 #else
  #define UNUSED
 #endif
+#if __has_attribute(format)
+ #define PRINTF __attribute__ ((format (printf, 1, 2)))
+#else
+ #define PRINTF
+#endif
 
 enum glyph_attribute {
        ATTR_NULL       = 0,
-- 
2.20.1


Reply via email to