1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-23 00:15:58 +01:00

Fix -Wextra-semi-stmt error with proper macro hygiene

"empty expression statement has no effect; remove unnecessary ';'"

These macros were not properly wrapped
This commit is contained in:
Ross Smyth
2025-07-02 21:12:40 -04:00
parent 442a060acd
commit 1638627cb5
2 changed files with 6 additions and 7 deletions

View File

@@ -13,7 +13,6 @@ E = -Weverything
CFLAGS += $E -Wno-unknown-warning-option -Wno-missing-prototypes
CFLAGS += -Wno-unused-macros -Wno-padded -Wno-missing-noreturn
CFLAGS += -Wno-unsafe-buffer-usage -Wno-reserved-identifier
CFLAGS += -Wno-extra-semi-stmt
endif
CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror
#CFLAGS += -Wconversion #disabled because if falsely complains about the isinf and isnan macros

View File

@@ -133,19 +133,19 @@ void flushSpy(void)
if (flushSpyEnabled){ flushSpyCalls++; }
}
#define TEST_ASSERT_EQUAL_PRINT_NUMBERS(expected, actual) { \
#define TEST_ASSERT_EQUAL_PRINT_NUMBERS(expected, actual) do { \
startPutcharSpy(); UnityPrintNumber((actual)); endPutcharSpy(); \
TEST_ASSERT_EQUAL_STRING((expected), getBufferPutcharSpy()); \
}
} while (0)
#define TEST_ASSERT_EQUAL_PRINT_UNSIGNED_NUMBERS(expected, actual) { \
#define TEST_ASSERT_EQUAL_PRINT_UNSIGNED_NUMBERS(expected, actual) do { \
startPutcharSpy(); UnityPrintNumberUnsigned((actual)); endPutcharSpy(); \
TEST_ASSERT_EQUAL_STRING((expected), getBufferPutcharSpy()); \
}
} while (0)
#define TEST_ASSERT_EQUAL_PRINT_FLOATING(expected, actual) { \
#define TEST_ASSERT_EQUAL_PRINT_FLOATING(expected, actual) do { \
startPutcharSpy(); UnityPrintFloat((actual)); endPutcharSpy(); \
TEST_ASSERT_EQUAL_STRING((expected), getBufferPutcharSpy()); \
}
} while (0)
#endif