scanner: add missing attributes

These allow better checking by the compiler.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
This commit is contained in:
Demi Marie Obenour 2022-11-08 01:43:48 -05:00 committed by Demi Marie Obenour
parent 0c532fa783
commit cd5b4bcca7

View file

@ -380,7 +380,7 @@ desc_dump(char *desc, const char *fmt, ...)
putchar('\n'); putchar('\n');
} }
static void __attribute__ ((noreturn)) static void __attribute__((format(printf, 2, 3), noreturn))
fail(struct location *loc, const char *msg, ...) fail(struct location *loc, const char *msg, ...)
{ {
va_list ap; va_list ap;
@ -394,7 +394,7 @@ fail(struct location *loc, const char *msg, ...)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
static void static void __attribute__((format(printf, 2, 3)))
warn(struct location *loc, const char *msg, ...) warn(struct location *loc, const char *msg, ...)
{ {
va_list ap; va_list ap;
@ -836,7 +836,7 @@ start_element(void *data, const char *element_name, const char **atts)
switch (arg->type) { switch (arg->type) {
case NEW_ID: case NEW_ID:
ctx->message->new_id_count++; ctx->message->new_id_count++;
/* fallthrough */ __attribute__((fallthrough));
case OBJECT: case OBJECT:
if (interface_name) { if (interface_name) {
validate_identifier(&ctx->loc, validate_identifier(&ctx->loc,