From a533f9080d1a4cd645d0129db4d71487c5375086 Mon Sep 17 00:00:00 2001 From: Jasper Date: Tue, 2 Sep 2025 18:30:22 +0200 Subject: '__VA_ARGS__' in benchmark macro -> '##__VA_ARGS__' Seems to solve the empty argument problem for macros with variadic argument lists. GCC only --- debug.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'debug.c') diff --git a/debug.c b/debug.c index 844e8e8..e37f740 100644 --- a/debug.c +++ b/debug.c @@ -45,7 +45,7 @@ #define BENCHMARK_RAND1(m, n, bound_l, bound_u, func,...) \ do { \ Matrix *A = matrix_rand((m), (n), (bound_l), (bound_u), MATRIX_NONE); \ - func(A, __VA_ARGS__); \ + func(A, ##__VA_ARGS__); \ free(A); \ } while(0) @@ -55,7 +55,6 @@ int main() /* run_tests() */ /* TODO: Add timing. For now the macro executes the given function once */ - /* TODO: Fix for functions that take just the matrix and no additional arguments */ BENCHMARK_RAND1( 100, 100, /* Dimensions: m x n */ 0, 100, /* Value bounds */ -- cgit v1.2.3