From 65a36cd444bbc644fa507ef59be32216f36b4867 Mon Sep 17 00:00:00 2001 From: Michal Podhradsky Date: Sun, 2 Jun 2024 10:18:34 -0700 Subject: [PATCH] Don't include stdio.h when using CN --- .../src/components/actuator.c | 11 +++++++++-- .../mission_protection_system/src/include/wars.h | 5 +++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/components/mission_protection_system/src/components/actuator.c b/components/mission_protection_system/src/components/actuator.c index 4a44b59b..fbd9373d 100644 --- a/components/mission_protection_system/src/components/actuator.c +++ b/components/mission_protection_system/src/components/actuator.c @@ -19,10 +19,17 @@ #include "actuation_logic.h" #ifdef PLATFORM_HOST +// CN currently does not support +// see https://github.com/rems-project/cerberus/issues/277 +// for details +#ifdef CN_ENV +#include "printf.h" +#else // CN_ENV not defined #include -#else +#endif // define CN_ENV +#else // PLATFORM_HOST not defined #include "printf.h" -#endif +#endif // ifdef PLATFORM_HOST #define w1 uint8_t #define w2 uint8_t diff --git a/components/mission_protection_system/src/include/wars.h b/components/mission_protection_system/src/include/wars.h index 0446bbd3..e9e08a41 100644 --- a/components/mission_protection_system/src/include/wars.h +++ b/components/mission_protection_system/src/include/wars.h @@ -1,5 +1,10 @@ // general things not yet supported by CN +// define that we are using CN for code checking +// NOTE: eventually we don't want to differentiate between the checked +// code and the deployed code +#define CN_ENV 1 + // the simplest workaround for unions (making it a struct) don't make sense if // the union is used to access the same data from different perspectives, but if // it's just used as a simple sum type it's merely wasteful to use a struct