Skip to content

Commit 4dc9830

Browse files
committed
Fix Wmissing-noreturn errors
1 parent 2fabc9e commit 4dc9830

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

test/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ endif
1111
ifeq ($(findstring clang, $(CC)), clang)
1212
E = -Weverything
1313
CFLAGS += $E -Wno-unknown-warning-option -Wno-missing-prototypes
14-
CFLAGS += -Wno-unused-macros -Wno-padded -Wno-missing-noreturn
14+
CFLAGS += -Wno-unused-macros -Wno-padded
1515
CFLAGS += -Wno-unsafe-buffer-usage
1616
endif
1717
CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror

test/tests/test_unity_core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,19 @@ void testUnitySizeInitializationReminder(void)
9292
TEST_ASSERT_EQUAL_MESSAGE(sizeof(Expected_Unity), sizeof(Unity), message);
9393
}
9494

95-
void testPassShouldEndImmediatelyWithPass(void)
95+
__attribute__((noreturn)) void testPassShouldEndImmediatelyWithPass(void)
9696
{
9797
TEST_PASS();
9898
TEST_FAIL_MESSAGE("We should have passed already and finished this test");
9999
}
100100

101-
void testPassShouldEndImmediatelyWithPassAndMessage(void)
101+
__attribute__((noreturn)) void testPassShouldEndImmediatelyWithPassAndMessage(void)
102102
{
103103
TEST_PASS_MESSAGE("Woohoo! This Automatically Passes!");
104104
TEST_FAIL_MESSAGE("We should have passed already and finished this test");
105105
}
106106

107-
void testMessageShouldDisplayMessageWithoutEndingAndGoOnToPass(void)
107+
__attribute__((noreturn)) void testMessageShouldDisplayMessageWithoutEndingAndGoOnToPass(void)
108108
{
109109
TEST_MESSAGE("This is just a message");
110110
TEST_MESSAGE("This is another message");
@@ -282,7 +282,7 @@ void testProtection(void)
282282
TEST_ASSERT_EQUAL(3, mask);
283283
}
284284

285-
void testIgnoredAndThenFailInTearDown(void)
285+
__attribute__((noreturn)) void testIgnoredAndThenFailInTearDown(void)
286286
{
287287
SetToOneToFailInTearDown = 1;
288288
TEST_IGNORE();

test/tests/test_unity_floats.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,6 +1208,9 @@ void testNotEqualFloatEachEqualLengthZero(void)
12081208
#endif
12091209
}
12101210

1211+
#if defined(UNITY_EXCLUDE_FLOAT_PRINT) || defined(UNITY_INCLUDE_DOUBLE) || !defined(USING_OUTPUT_SPY)
1212+
__attribute__((noreturn))
1213+
#endif
12111214
void testFloatPrinting(void)
12121215
{
12131216
#if defined(UNITY_EXCLUDE_FLOAT_PRINT) || defined(UNITY_INCLUDE_DOUBLE) || !defined(USING_OUTPUT_SPY)
@@ -1257,6 +1260,9 @@ void testFloatPrinting(void)
12571260
#endif
12581261
}
12591262

1263+
#if defined(UNITY_EXCLUDE_FLOAT_PRINT) || defined(UNITY_INCLUDE_DOUBLE) || !defined(USING_OUTPUT_SPY)
1264+
__attribute__((noreturn))
1265+
#endif
12601266
void testFloatPrintingRoundTiesToEven(void)
12611267
{
12621268
#if defined(UNITY_EXCLUDE_FLOAT_PRINT) || defined(UNITY_INCLUDE_DOUBLE) || !defined(USING_OUTPUT_SPY)
@@ -1368,6 +1374,9 @@ static void printFloatValue(float f)
13681374
#endif
13691375
#endif
13701376

1377+
#if !defined(UNITY_TEST_ALL_FLOATS_PRINT_OK) || !defined(USING_OUTPUT_SPY)
1378+
__attribute__((noreturn))
1379+
#endif
13711380
void testFloatPrintingRandomSamples(void)
13721381
{
13731382
#if !defined(UNITY_TEST_ALL_FLOATS_PRINT_OK) || !defined(USING_OUTPUT_SPY)

0 commit comments

Comments
 (0)