summaryrefslogtreecommitdiff
path: root/arch/x86/tools/relocs.h
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2021-06-25 18:10:16 +0300
committerBorislav Petkov <bp@suse.de>2021-08-23 06:58:02 +0300
commit03dca99e200f4d268f70079cf54e3b1200c9eb9d (patch)
tree5702e29034d1b485fbf3817cbdf066225a339c21 /arch/x86/tools/relocs.h
parent989ceac799cb28a477304cdc9ee72995191c6378 (diff)
downloadlinux-03dca99e200f4d268f70079cf54e3b1200c9eb9d.tar.xz
x86/tools/relocs: Mark die() with the printf function attr format
Mark die() as a function which accepts printf-style arguments so that the compiler can typecheck them against the supplied format string. Use the C99 inttypes.h format specifiers as relocs.c gets built for both 32- and 64-bit. Original version of the patch by Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: http://lkml.kernel.org/r/YNnb6Q4QHtNYC049@zn.tnic
Diffstat (limited to 'arch/x86/tools/relocs.h')
-rw-r--r--arch/x86/tools/relocs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/tools/relocs.h b/arch/x86/tools/relocs.h
index 43c83c0fd22c..4c49c82446eb 100644
--- a/arch/x86/tools/relocs.h
+++ b/arch/x86/tools/relocs.h
@@ -17,6 +17,7 @@
#include <regex.h>
#include <tools/le_byteshift.h>
+__attribute__((__format__(printf, 1, 2)))
void die(char *fmt, ...) __attribute__((noreturn));
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))