Skip to content

FE_XXX macro redefinition warnings when compiling with streflop #767

@bruno-dasilva

Description

@bruno-dasilva

Hi folks, when we try and use both sse2neon and streflop together in over at https://github.com/beyond-all-reason/RecoilEngine/, streflop emits a ton of warnings:

/build/src/rts/lib/streflop/FPUSettings.h:105:2: warning: #warning STREFLOP: FE_XXX flags were already
  defined and will be redefined! Check you do not use the system libm. [-Wcpp]
    105 | #warning STREFLOP: FE_XXX flags were already defined and will be redefined! Check you do not use
  the system libm.
        |  ^~~~~~~

From what I can tell this is because sse2neon pulls in #include <fenv.h> (which defines FE_INVALID, FE_TONEAREST, … as macros) which then leaks out to any places that include sse2neon. I don't think these are necessary outside of the sse2neon code itself?

Those conflict with streflop which intentionally defines its own FE_XXX macros (the whole point of streflop is to replace the system libm with bit-for-bit reproducible math across platforms).

My workaround is to undef them from sse2neon in the build.

Questions

  1. is undef'ing them from sse2neon the right solution?
  2. If so, should these be undef'd in this repo?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions