1
0
Fork 0
mirror of https://passt.top/passt synced 2025-05-25 18:45:37 +02:00

platform requirements: Add attributes to die() function

Add both format string and ((noreturn)) attributes to the version of die()
used in the test programs in doc/platform-requirements.  As well as
potentially catching problems in format strings, this means that the
compiler and static checkers can properly reason about the fact that it
will exit, preventing bogus warnings.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
David Gibson 2025-04-02 14:13:17 +11:00 committed by Stefano Brivio
parent 2ed2d59def
commit 8e32881ef1

View file

@ -15,6 +15,7 @@
#include <stdio.h>
#include <stdlib.h>
__attribute__((format(printf, 1, 2), noreturn))
static inline void die(const char *fmt, ...)
{
va_list ap;