Skip to content
Snippets Groups Projects
  1. Jun 05, 2024
  2. May 31, 2024
  3. May 22, 2024
  4. Apr 29, 2024
  5. Apr 05, 2024
  6. Mar 29, 2024
  7. Mar 26, 2024
  8. Mar 15, 2024
  9. Mar 14, 2024
  10. Feb 27, 2024
  11. Feb 14, 2024
  12. Feb 09, 2024
  13. Jan 23, 2024
  14. Dec 20, 2023
  15. Nov 29, 2023
  16. Nov 25, 2023
    • Marvin Häuser's avatar
      simulator: fix pedantic C++ 98 warnings · b0db5d4d
      Marvin Häuser authored
      C++ 98 requires all source files to terminate with a new-line character.
      It also does not allow for semicolons outside of declarations that
      require it (and in function scopes). Fix them to allow for pedantic
      warnings to be enabled when beneficial. Finally, it does not allow for
      object-to-function casts.
      
      The first two warnings are resolved trivially. For the third, the
      solution to cast through a pointer address is technically unsafe, as
      systems are not required to support object pointers (e.g. void *)
      being able to represent function pointers. However, the existence of
      dlsym() virtually implies this is supported on the target system
      (technically, all symbols could be data symbols, but that is
      nitpicking).
      b0db5d4d
    • Marvin Häuser's avatar
      simulator: add failsafe for stochastic guards · 50a40483
      Marvin Häuser authored
      Stochastic guards are supposed to be generated in a way that the if
      branches are disjoint and exhaustive. Compilers have trouble verifying
      the latter property, as they usually do not pick up postconditions on
      return value of myrand(0, 99).
      
      To silence warnings regarded control paths that do not return a value,
      and to add hardening against code generation bugs that actually violate
      exhaustion of the if branches, assert() and abort() at the end of such
      functions.
      50a40483
    • Marvin Häuser's avatar
      simulator: separate action and delay action · c3bd3a27
      Marvin Häuser authored
      Commit f1db3a0a adjusted
      ActionFuncPointer to generally return a delay. However, this is only
      done for TMLDelayAction generation, leaving the other producers of
      ActionFuncPointer emitting functions without a return value despite the
      changed return type.
      
      To address this, distinguish between ActionFuncPointer and
      DelayActionFuncPointer.
      c3bd3a27
    • Marvin Häuser's avatar
      simulator: emit channels array only when not empty · 0d76645a
      Marvin Häuser authored
      Arrays of length 0 yield implementation-defined behaviour, which causes
      a compiler warning. In C, this was typically used to model
      flexibly-sized array members trailing a struct. Here, length 0 actually
      means it occupies no storage.
      
      Hence, do not emit the _channels array when it would otherwise have a
      length of 0.
      0d76645a
Loading