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:
parent
2ed2d59def
commit
8e32881ef1
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue