Skip to content
Snippets Groups Projects
  1. Nov 29, 2023
  2. Nov 28, 2023
  3. Nov 27, 2023
  4. Nov 26, 2023
  5. Nov 25, 2023
    • Marvin Häuser's avatar
      simulator: enable extra errors and -Werror · 7c855a63
      Marvin Häuser authored
      As no warnings remain as of now, enable extra warnings and treat them as
      errors. This should reduce the risk for hidden errors.
      7c855a63
    • Marvin Häuser's avatar
      f62c886c
    • Marvin Häuser's avatar
      9f51e068
    • 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: fix non-extensive switch · 92394855
      Marvin Häuser authored
      92394855
    • Marvin Häuser's avatar
      simulator: remove unused variables · 29074d76
      Marvin Häuser authored
      29074d76
    • 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: correctly implement TMLCommand · fe4549b0
      Marvin Häuser authored
      TMLNotifiedCommand, unlike many other child classes, does not implement
      the virtual functions getNbOfChannels() and getChannel() of its parent
      class TMLCommand. Implement them by exposing its sole channel.
      fe4549b0
    • Marvin Häuser's avatar
      simulator: drop inconsistent override keyword · ef5b4abe
      Marvin Häuser authored
      Some compilers warn about inconsistent usage of the override keyword.
      As not all but some overridden virtual functions are marked as such,
      said warning triggers. Because the keyword is not used extensively and
      is not supported by the default C++ 98 mode, drop the current uses.
      ef5b4abe
    • 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
    • Marvin Häuser's avatar
      simulator: fix printing the command file name · 065677ee
      Marvin Häuser authored
      Printing the command file name via piping the ifstream causes a build
      error with the C++ 11 standard forced. Replace the ifstream with the
      original file name string.
      065677ee
    • Marvin Häuser's avatar
      simulator: fix final() macro overriding keyword · c99f89e8
      Marvin Häuser authored
      The final() macro used for hashing overrides the language keyword final,
      which may cause compilation issues for otherwise valid code. Rename it
      to resolve the collision.
      c99f89e8
    • Marvin Häuser's avatar
      simulator: fix signedness mismatches · 56321bb9
      Marvin Häuser authored
      Extra compiler warnings include signedness mismatches of comparison
      operations, as the implicit type promotion may unexpectedly convert
      negative values and thus skew the result. Adjust the affected signed
      types to unsigned types, as the corresponding values cannot be negative
      anyway.
      56321bb9
    • Marvin Häuser's avatar
      simulator: remove erroneous escape sequence · 5715770e
      Marvin Häuser authored
      The character '<' does not have any functional meaning and thus cannot
      be escaped.
      5715770e
    • Marvin Häuser's avatar
      simulator: fix potentially uninitialized returns · 1e0c10fc
      Marvin Häuser authored
      Some operations to insert or remove samples may leave their return value
      uninitialized under exceptional conditions. Return 0 in these cases to
      indicate to samples were inserted or removed.
      1e0c10fc
    • Marvin Häuser's avatar
      [WIP] simulation: fix NULL dereference · 6f1d3dd6
      Marvin Häuser authored
      oLastTrans may be NULL when saving the benchmark to file. The current
      logic does not handle this correctly, dereferencing it for a print.
      Print a dummy value when the variable is NULL to resolve the issue.
      6f1d3dd6
    • Marvin Häuser's avatar
      simulator: fix potentially uninitialized argument · b60d3448
      Marvin Häuser authored
      Simulator::simulate() should guarantee its argument oLastTrans is
      initialized when it returns. However, not all code paths currently do
      so. To resolve the issue, initialize it to NULL in the beginning.
      b60d3448
    • Marvin Häuser's avatar
      simulator: fix variadic iteration UB · 0e1e8c65
      Marvin Häuser authored
      The current logic calls va_arg() once after the actual last argument has
      been retrieved. While this should usually not cause real-world problems,
      it is undefined behaviour caught by AddressSanitizer.
      0e1e8c65
    • Ludovic Apvrille's avatar
      update on build version: build.txt · a488a6a8
      Ludovic Apvrille authored
      a488a6a8
  6. Nov 24, 2023
  7. Nov 23, 2023
  8. Nov 22, 2023
  9. Nov 21, 2023
  10. Nov 20, 2023
Loading