Ceedling
Ceedling copied to clipboard
Compilation error in gcc c99 when UNITY_INCLUDE_EXEC_TIME defined in project.yml
With the default project.yml (as of 1.0.1) and this mixin:
:unity:
:defines:
- UNITY_EXCLUDE_FLOAT
- UNITY_INCLUDE_EXEC_TIME
:flags:
:test:
:compile:
:*:
- -std=c99
Complation fails with:
ceedling --mixin=c99bug.yml
Compiling test_c99_compilation.c...
🧨 EXCEPTION: 'Default Test Compiler' (gcc) terminated with exit code [1] and output >>
In file included from build/vendor/unity/src/unity.h:22,
from test/test_c99_compilation.c:1:
build/vendor/unity/src/unity_internals.h:530:21: error: field ‘CurrentTestStartTime’ has incomplete type
530 | UNITY_TIME_TYPE CurrentTestStartTime;
| ^~~~~~~~~~~~~~~~~~~~
build/vendor/unity/src/unity_internals.h:531:21: error: field ‘CurrentTestStopTime’ has incomplete type
531 | UNITY_TIME_TYPE CurrentTestStopTime;
| ^~~~~~~~~~~~~~~~~~~
🌱 Ceedling could not complete operations because of errors
Platform: Linux Mint Ceedling Ver:
Welcome to Ceedling!
Ceedling => 1.0.1-fb1ce6c
----------------------
/var/lib/gems/3.2.0/gems/ceedling-1.0.1/
Build Frameworks
----------------------
CMock => 2.6.0
Unity => 2.6.1
CException => 1.3.4
And without mixin it works?
If you are on Linux/macOS and use c99 then you might need to set the following define in your project.yml
_POSIX_C_SOURCE=200809L