On 05.03.21 13:40, Julien Grall wrote:
From: Julien Grall <jgr...@amazon.com>Allow GCC to analyze the format printf for xprintf() and barf{,_perror}(). Take the opportunity to define __noreturn to make the prototype for barf{,_perror})() easier to read. Signed-off-by: Julien Grall <jgr...@amazon.com>
Reviewed-by: Juergen Gross <jgr...@suse.com> But I would prefer, if ...
--- tools/xenstore/utils.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/xenstore/utils.h b/tools/xenstore/utils.h index 3dfb96b556dd..ccfb9b8fb699 100644 --- a/tools/xenstore/utils.h +++ b/tools/xenstore/utils.h @@ -29,10 +29,12 @@ const char *dump_state_align(FILE *fp);#define PRINTF_ATTRIBUTE(a1, a2) __attribute__((format (printf, a1, a2))) -void barf(const char *fmt, ...) __attribute__((noreturn));-void barf_perror(const char *fmt, ...) __attribute__((noreturn)); +#define __noreturn __attribute__((noreturn))-extern void (*xprintf)(const char *fmt, ...);+void barf(const char *fmt, ...) __noreturn PRINTF_ATTRIBUTE(1, 2); +void barf_perror(const char *fmt, ...) __noreturn PRINTF_ATTRIBUTE(1, 2); + +extern void (*xprintf)(const char *fmt, ...) PRINTF_ATTRIBUTE(1, 2);
... the extern here would be dropped. Juergen
OpenPGP_0xB0DE9DD628BF132F.asc
Description: application/pgp-keys
OpenPGP_signature
Description: OpenPGP digital signature