diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-10-27 23:57:08 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-27 10:57:08 -0400 |
commit | 367884c65912b3305d18f74b84b7c9e396d14161 (patch) | |
tree | 11d49b2f1859782476f2c6681c099ab024f25a9c /misc/yjit_asm_tests.c | |
parent | a6104b392ab347c323c93a51fb3b95c3c2cc9e8f (diff) |
Fix yjit_asm_tests.c as C99 compliant (#5033)
* rb_bug should be variadic
* Prefer ANSI-style prototypes over old K&R-style definitions
* Add missing argument types
Notes
Notes:
Merged-By: maximecb <maximecb@ruby-lang.org>
Diffstat (limited to 'misc/yjit_asm_tests.c')
-rw-r--r-- | misc/yjit_asm_tests.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/misc/yjit_asm_tests.c b/misc/yjit_asm_tests.c index 7650505fb3..0bd11e4752 100644 --- a/misc/yjit_asm_tests.c +++ b/misc/yjit_asm_tests.c @@ -1,6 +1,7 @@ // For MAP_ANONYMOUS on GNU/Linux #define _GNU_SOURCE 1 +#include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -9,9 +10,12 @@ // This test executable doesn't compile with the rest of Ruby // so we need to define a rb_bug(). _Noreturn -static void rb_bug(char *message) +static void rb_bug(const char *message, ...) { - fprintf(stderr, "%s\n", message); + va_list args; + va_start(args, message); + vfprintf(stderr, message, args); + va_end(args); abort(); } @@ -71,7 +75,7 @@ void check_bytes(codeblock_t* cb, const char* bytes) } } -void run_assembler_tests() +void run_assembler_tests(void) { printf("Running assembler tests\n"); @@ -366,7 +370,7 @@ void run_assembler_tests() printf("Assembler tests done\n"); } -void assert_equal(expected, actual) +void assert_equal(int expected, int actual) { if (expected != actual) { fprintf(stderr, "expected %d, got %d\n", expected, actual); @@ -374,7 +378,7 @@ void assert_equal(expected, actual) } } -void run_runtime_tests() +void run_runtime_tests(void) { printf("Running runtime tests\n"); |