Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,17 @@ set(custom_compiler_flags)
include(CheckCCompilerFlag)
option(ENABLE_CUSTOM_COMPILER_FLAGS "Enables custom compiler flags" ON)
if (ENABLE_CUSTOM_COMPILER_FLAGS)
if (("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU"))
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
list(APPEND custom_compiler_flags
-std=c89
-pedantic
-Weverything
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-Weverything is not something I'm willing to put in there. I use it from time to time in order to find new warnings that I can use though.

-Werror
-Wno-float-equal
-Wno-padded
-Wno-covered-switch-default
)
elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
list(APPEND custom_compiler_flags
-std=c89
-pedantic
Expand Down
4 changes: 3 additions & 1 deletion tests/unity/src/unity.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ void UnityPrintMask(const UNITY_UINT mask, const UNITY_UINT number)
* precision case) and isn't attempted here. */
void UnityPrintFloat(const UNITY_DOUBLE input_number)
{
UNITY_DOUBLE number = input_number;
float number = (float)input_number;

/* print minus sign (including for negative zero) */
if (number < 0.0f || (number == 0.0f && 1.0f / number < 0.0f))
Expand Down Expand Up @@ -803,6 +803,7 @@ void UnityAssertFloatSpecial(const UNITY_FLOAT actual,
is_trait = !isinf(actual) && !isnan(actual);
break;

case UNITY_FLOAT_INVALID_TRAIT:
default:
trait_index = 0;
trait_names[0] = UnityStrInvalidFloatTrait;
Expand Down Expand Up @@ -933,6 +934,7 @@ void UnityAssertDoubleSpecial(const UNITY_DOUBLE actual,
is_trait = !isinf(actual) && !isnan(actual);
break;

case UNITY_FLOAT_INVALID_TRAIT:
default:
trait_index = 0;
trait_names[0] = UnityStrInvalidFloatTrait;
Expand Down