Skip to content

Commit

Permalink
Merge pull request #59 from GaloisInc/bugfix-cn-failing-on-stdio
Browse files Browse the repository at this point in the history
Don't include stdio.h when using CN
  • Loading branch information
podhrmic authored Jun 2, 2024
2 parents ff395f0 + 65a36cd commit d8918b4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 9 additions & 2 deletions components/mission_protection_system/src/components/actuator.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@
#include "actuation_logic.h"

#ifdef PLATFORM_HOST
// CN currently does not support <stdio.h>
// see https://github.com/rems-project/cerberus/issues/277
// for details
#ifdef CN_ENV
#include "printf.h"
#else // CN_ENV not defined
#include <stdio.h>
#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
Expand Down
5 changes: 5 additions & 0 deletions components/mission_protection_system/src/include/wars.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit d8918b4

Please sign in to comment.