From 8c28f7a3a5b04793691da82786387656566621ba Mon Sep 17 00:00:00 2001 From: John Safranek Date: Fri, 1 Mar 2024 16:02:30 -0800 Subject: [PATCH] Update Pragma Macro Use 1. The wrapper for the pragma PRAGMA_GCC_DIAG_PUSH and its friends are not set up to be used like a function. Remove the semicolons after their usage. (Clang doesn't care, but MSVC does.) --- tests/api.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/api.c b/tests/api.c index 0a9e763f..2de3ab6f 100644 --- a/tests/api.c +++ b/tests/api.c @@ -120,13 +120,13 @@ char* myoptarg = NULL; #define AssertStrLE(x, y) AssertStr(x, y, <=, >) #define AssertPtr(x, y, op, er) do { \ - PRAGMA_GCC_DIAG_PUSH; \ + PRAGMA_GCC_DIAG_PUSH \ /* remarkably, without this inhibition, */ \ /* the _Pragma()s make the declarations warn. */ \ - PRAGMA_GCC("GCC diagnostic ignored \"-Wdeclaration-after-statement\""); \ + PRAGMA_GCC("GCC diagnostic ignored \"-Wdeclaration-after-statement\"") \ /* inhibit "ISO C forbids conversion of function pointer */ \ /* to object pointer type [-Werror=pedantic]" */ \ - PRAGMA_GCC("GCC diagnostic ignored \"-Wpedantic\""); \ + PRAGMA_GCC("GCC diagnostic ignored \"-Wpedantic\"") \ void* _x = (void*)(x); \ void* _y = (void*)(y); \ Assert(_x op _y, ("%s " #op " %s", #x, #y), ("%p " #er " %p", _x, _y)); \