Skip to content

Commit 3765785

Browse files
committed
Allow UNIMPLEMENTED to take no format args
1 parent 8eeaeb1 commit 3765785

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/asm_gen.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,8 +1947,7 @@ static void write_const(AsmModule *asm_module, IrConst *konst, Array(u8) *out)
19471947
write_int_bytes(out, raw_bits, 8);
19481948
} else {
19491949
// 80-bit long double
1950-
UNIMPLEMENTED(
1951-
"float constant with bit width %u", konst->type.u.bit_width);
1950+
UNIMPLEMENTED("long double float constant");
19521951
}
19531952
break;
19541953
case IR_POINTER: {

src/exit_code.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ typedef enum ExitCode
1818

1919
NORETURN inline void exit_with_code(ExitCode code) { exit((int)code); }
2020

21-
#define UNIMPLEMENTED(fmt, ...) \
22-
_exit_unimplemented(__FILE__, __LINE__, fmt, __VA_ARGS__)
21+
#define UNIMPLEMENTED(...) _exit_unimplemented(__FILE__, __LINE__, __VA_ARGS__)
2322
NORETURN void _exit_unimplemented(
2423
const char *file, int line, const char *format, ...);
2524

src/syntax/preprocess.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ static bool handle_pp_directive(PP *pp)
727727

728728
skip_whitespace_and_comments(pp, false);
729729
} else if (strneq(directive.chars, "line", directive.len)) {
730-
UNIMPLEMENTED("#line preprocessor directive", 0);
730+
UNIMPLEMENTED("#line preprocessor directive");
731731
} else if (strneq(directive.chars, "error", directive.len)) {
732732
advance(reader);
733733

@@ -739,7 +739,7 @@ static bool handle_pp_directive(PP *pp)
739739
emit_error(&directive_start, error);
740740
return false;
741741
} else if (strneq(directive.chars, "pragma", directive.len)) {
742-
UNIMPLEMENTED("#pragma preprocessor directive", 0);
742+
UNIMPLEMENTED("#pragma preprocessor directive");
743743
} else {
744744
emit_error(
745745
&reader->source_loc, "Invalid preprocessor directive: %s", directive);

0 commit comments

Comments
 (0)