From 0028136821365ba0d29332900e8801d94151abc3 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 13 Jan 2017 14:27:48 +0100 Subject: util: Add printf format GCC attribute to panic() function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes the following GCC warning: util.h:55:2: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format] Signed-off-by: Tobias Klauser --- compiler.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'compiler.h') 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 + * Copyright (C) 2015-2017 Tobias Klauser * * 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 -- cgit v1.2.3-54-g00ecf