mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-09-09 03:39:59 +00:00
Fix -Wmissing-prototypes errors
This one was a bit tough, but I think this works fine.
This commit is contained in:
+1
-1
@@ -10,7 +10,7 @@ CC = clang
|
|||||||
endif
|
endif
|
||||||
ifeq ($(findstring clang, $(CC)), clang)
|
ifeq ($(findstring clang, $(CC)), clang)
|
||||||
E = -Weverything
|
E = -Weverything
|
||||||
CFLAGS += $E -Wno-unknown-warning-option -Wno-missing-prototypes
|
CFLAGS += $E -Wno-unknown-warning-option
|
||||||
CFLAGS += -Wno-unsafe-buffer-usage
|
CFLAGS += -Wno-unsafe-buffer-usage
|
||||||
endif
|
endif
|
||||||
CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror
|
CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror
|
||||||
|
|||||||
@@ -72,6 +72,11 @@ static char putcharSpyBuffer[SPY_BUFFER_MAX];
|
|||||||
static UNITY_COUNTER_TYPE indexSpyBuffer;
|
static UNITY_COUNTER_TYPE indexSpyBuffer;
|
||||||
static UNITY_COUNTER_TYPE putcharSpyEnabled;
|
static UNITY_COUNTER_TYPE putcharSpyEnabled;
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wmissing-prototypes"
|
||||||
|
#endif
|
||||||
|
|
||||||
void startPutcharSpy(void)
|
void startPutcharSpy(void)
|
||||||
{
|
{
|
||||||
indexSpyBuffer = 0;
|
indexSpyBuffer = 0;
|
||||||
@@ -133,6 +138,10 @@ void flushSpy(void)
|
|||||||
if (flushSpyEnabled){ flushSpyCalls++; }
|
if (flushSpyEnabled){ flushSpyCalls++; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
#define TEST_ASSERT_EQUAL_PRINT_NUMBERS(expected, actual) do { \
|
#define TEST_ASSERT_EQUAL_PRINT_NUMBERS(expected, actual) do { \
|
||||||
startPutcharSpy(); UnityPrintNumber((actual)); endPutcharSpy(); \
|
startPutcharSpy(); UnityPrintNumber((actual)); endPutcharSpy(); \
|
||||||
TEST_ASSERT_EQUAL_STRING((expected), getBufferPutcharSpy()); \
|
TEST_ASSERT_EQUAL_STRING((expected), getBufferPutcharSpy()); \
|
||||||
@@ -149,3 +158,10 @@ void flushSpy(void)
|
|||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// The reason this isn't folded into the above diagnostic is to semi-isolate
|
||||||
|
// the header contents from the user content it is included into.
|
||||||
|
#ifdef __clang__
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wmissing-prototypes"
|
||||||
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user