mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-28 10:44:26 +01:00
Merge pull request #186 from xor-gate/strict-cflag-fix-missing-var-decl-clang
Fixup issues when compiling with clang -Wmissing-variable-declarations
This commit is contained in:
63
src/unity.c
63
src/unity.c
@@ -19,37 +19,36 @@ extern int UNITY_OUTPUT_CHAR(int);
|
|||||||
|
|
||||||
struct _Unity Unity;
|
struct _Unity Unity;
|
||||||
|
|
||||||
const char UnityStrOk[] = "OK";
|
static const char UnityStrOk[] = "OK";
|
||||||
const char UnityStrPass[] = "PASS";
|
static const char UnityStrPass[] = "PASS";
|
||||||
const char UnityStrFail[] = "FAIL";
|
static const char UnityStrFail[] = "FAIL";
|
||||||
const char UnityStrIgnore[] = "IGNORE";
|
static const char UnityStrIgnore[] = "IGNORE";
|
||||||
const char UnityStrNull[] = "NULL";
|
static const char UnityStrNull[] = "NULL";
|
||||||
const char UnityStrSpacer[] = ". ";
|
static const char UnityStrSpacer[] = ". ";
|
||||||
const char UnityStrExpected[] = " Expected ";
|
static const char UnityStrExpected[] = " Expected ";
|
||||||
const char UnityStrWas[] = " Was ";
|
static const char UnityStrWas[] = " Was ";
|
||||||
const char UnityStrTo[] = " To ";
|
static const char UnityStrElement[] = " Element ";
|
||||||
const char UnityStrElement[] = " Element ";
|
static const char UnityStrByte[] = " Byte ";
|
||||||
const char UnityStrByte[] = " Byte ";
|
static const char UnityStrMemory[] = " Memory Mismatch.";
|
||||||
const char UnityStrMemory[] = " Memory Mismatch.";
|
static const char UnityStrDelta[] = " Values Not Within Delta ";
|
||||||
const char UnityStrDelta[] = " Values Not Within Delta ";
|
static const char UnityStrPointless[] = " You Asked Me To Compare Nothing, Which Was Pointless.";
|
||||||
const char UnityStrPointless[] = " You Asked Me To Compare Nothing, Which Was Pointless.";
|
static const char UnityStrNullPointerForExpected[] = " Expected pointer to be NULL";
|
||||||
const char UnityStrNullPointerForExpected[] = " Expected pointer to be NULL";
|
static const char UnityStrNullPointerForActual[] = " Actual pointer was NULL";
|
||||||
const char UnityStrNullPointerForActual[] = " Actual pointer was NULL";
|
static const char UnityStrNot[] = "Not ";
|
||||||
const char UnityStrNot[] = "Not ";
|
static const char UnityStrInf[] = "Infinity";
|
||||||
const char UnityStrInf[] = "Infinity";
|
static const char UnityStrNegInf[] = "Negative Infinity";
|
||||||
const char UnityStrNegInf[] = "Negative Infinity";
|
static const char UnityStrNaN[] = "NaN";
|
||||||
const char UnityStrNaN[] = "NaN";
|
static const char UnityStrDet[] = "Determinate";
|
||||||
const char UnityStrDet[] = "Determinate";
|
static const char UnityStrInvalidFloatTrait[] = "Invalid Float Trait";
|
||||||
const char UnityStrInvalidFloatTrait[] = "Invalid Float Trait";
|
const char UnityStrErrFloat[] = "Unity Floating Point Disabled";
|
||||||
const char UnityStrErrFloat[] = "Unity Floating Point Disabled";
|
const char UnityStrErrDouble[] = "Unity Double Precision Disabled";
|
||||||
const char UnityStrErrDouble[] = "Unity Double Precision Disabled";
|
const char UnityStrErr64[] = "Unity 64-bit Support Disabled";
|
||||||
const char UnityStrErr64[] = "Unity 64-bit Support Disabled";
|
static const char UnityStrBreaker[] = "-----------------------";
|
||||||
const char UnityStrBreaker[] = "-----------------------";
|
static const char UnityStrResultsTests[] = " Tests ";
|
||||||
const char UnityStrResultsTests[] = " Tests ";
|
static const char UnityStrResultsFailures[] = " Failures ";
|
||||||
const char UnityStrResultsFailures[] = " Failures ";
|
static const char UnityStrResultsIgnored[] = " Ignored ";
|
||||||
const char UnityStrResultsIgnored[] = " Ignored ";
|
static const char UnityStrDetail1Name[] = UNITY_DETAIL1_NAME " ";
|
||||||
const char UnityStrDetail1Name[] = UNITY_DETAIL1_NAME " ";
|
static const char UnityStrDetail2Name[] = " " UNITY_DETAIL2_NAME " ";
|
||||||
const char UnityStrDetail2Name[] = " " UNITY_DETAIL2_NAME " ";
|
|
||||||
|
|
||||||
#ifdef UNITY_FLOAT_NEEDS_ZERO
|
#ifdef UNITY_FLOAT_NEEDS_ZERO
|
||||||
// Dividing by these constants produces +/- infinity.
|
// Dividing by these constants produces +/- infinity.
|
||||||
@@ -58,7 +57,7 @@ static const _UF f_zero = 0.0f;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// compiler-generic print formatting masks
|
// compiler-generic print formatting masks
|
||||||
const _U_UINT UnitySizeMask[] =
|
static const _U_UINT UnitySizeMask[] =
|
||||||
{
|
{
|
||||||
255u, // 0xFF
|
255u, // 0xFF
|
||||||
65535u, // 0xFFFF
|
65535u, // 0xFFFF
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
CC = gcc
|
CC ?= gcc
|
||||||
ifeq ($(shell uname -s), Darwin)
|
ifeq ($(shell uname -s), Darwin)
|
||||||
CC = clang
|
CC ?= clang
|
||||||
endif
|
endif
|
||||||
#DEBUG = -O0 -g
|
#DEBUG = -O0 -g
|
||||||
CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror -Wredundant-decls
|
CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror -Wredundant-decls
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ static const _UD d_zero = 0.0;
|
|||||||
UNITY_OUTPUT_CHAR('\n'); \
|
UNITY_OUTPUT_CHAR('\n'); \
|
||||||
}
|
}
|
||||||
|
|
||||||
int SetToOneToFailInTearDown;
|
static int SetToOneToFailInTearDown;
|
||||||
int SetToOneMeanWeAlreadyCheckedThisGuy;
|
static int SetToOneMeanWeAlreadyCheckedThisGuy;
|
||||||
|
|
||||||
void setUp(void)
|
void setUp(void)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user