summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler.h6
-rw-r--r--util.h4
2 files changed, 8 insertions, 2 deletions
diff --git a/compiler.h b/compiler.h
index 4180086..8153f56 100644
--- a/compiler.h
+++ b/compiler.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015 Tobias Klauser <tklauser@distanz.ch>
+ * Copyright (C) 2015-2017 Tobias Klauser <tklauser@distanz.ch>
*
* This file is part of llmnrd.
*
@@ -28,6 +28,10 @@
# ifndef __unused
# define __unused __attribute__((unused))
# endif
+# ifndef __check_format_printf
+# define __check_format_printf(__fmt, __args) \
+ __attribute__ ((format (printf, (__fmt), (__args))))
+# endif
# ifndef offsetof
# define offsetof(a, b) __builtin_offsetof(a, b)
# endif
diff --git a/util.h b/util.h
index 0c3d263..1fabd5e 100644
--- a/util.h
+++ b/util.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014-2015 Tobias Klauser <tklauser@distanz.ch>
+ * Copyright (C) 2014-2017 Tobias Klauser <tklauser@distanz.ch>
* Copyright (C) 2009-2012 Daniel Borkmann
*
* This file is part of llmnrd.
@@ -47,6 +47,8 @@
(void) (&_max1 == &_max2); \
_max1 > _max2 ? _max1 : _max2; })
+static inline void panic(const char *fmt, ...) __check_format_printf(1, 2);
+
static inline void __noreturn panic(const char *fmt, ...)
{
va_list vl;