Skip to content

CPP macro usage in TArray relies on undefined behavior #75

@bgamari

Description

@bgamari

According to clang, the CPP guards in #66 rely on undefined behavior:

/private/var/lib/gitlab-runner/builds/7KQsmDei/0/ghc/ghc/libraries/stm/Control/Concurrent/STM/TArray.hs:9:5: error:
     error: macro expansion producing 'defined' has undefined behavior [-Werror,-Wexpansion-to-defined]
  |
9 | #if HAS_UNLIFTED_ARRAY
  |     ^
#if HAS_UNLIFTED_ARRAY
    ^
/private/var/lib/gitlab-runner/builds/7KQsmDei/0/ghc/ghc/libraries/stm/Control/Concurrent/STM/TArray.hs:7:28: error:
     note: expanded from macro 'HAS_UNLIFTED_ARRAY'
  |
7 | #define HAS_UNLIFTED_ARRAY defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 904
  |                            ^
#define HAS_UNLIFTED_ARRAY defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 904
                           ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions