Skip to content

#define _DETECTOR_BIT constants, ignore -Wstringop-overflow warnings

Karl Wette requested to merge ANU-CGA/lalsuite:detector-bit-swig-warnings into master

Description

  • lal/lib/tools/LALDetectors.h: #define the _DETECTOR_BIT constants instead of using enum
    • enum is always int (until C23/C++11) so LAL_ET*_DETECTOR_BIT constants overflow.
    • SWIG never did parse _DETECTOR_BIT definition correctly; silently ignored until v4.2.0.
  • Revert lal: pin swig < 4.2.0
  • Revert lalframe: pin swig < 4.2.0
  • Revert lalmetaio: pin swig < 4.2.0
  • Revert lalsimulation: pin swig < 4.2.0
  • Revert lalburst: pin swig < 4.2.0
  • Revert lalinspiral: pin swig < 4.2.0
  • Revert lalinference: pin swig < 4.2.0
  • Revert lalpulsar: pin swig < 4.2.0
  • Revert pin swig in common conda environment setup
  • gnuscripts/lalsuite_swig.m4: ignore -Wstringop-overflow warnings in wrapper code
    • SWIG wrapper code does some funky casting, which is correct, but confuses the warnings.
  • lal/lib/tools/LALDetectors.h: assign type name to enumeration of detectors
  • lal/lib/tools/LALDetectors.h: add inline SWIG function to compute detector DQ bits

API Changes and Justification

Backwards Compatible Changes

  • This change does not modify any class/function/struct/type definitions in a public C header file or any Python class/function definitions
  • This change adds new classes/functions/structs/types to a public C header file or Python module

enums aren't compiled into shared libraries, so changing the _DETECTOR_BIT constants from an enum to a #define is not an API/ABI change. It does, however, remove those constants from the SWIG interface, so it a backward-incompatible change to the SWIGLAL API. Those constants were never guaranteed to be defined correctly, however, and hopefully no one has been using them from SWIG.

Backwards Incompatible Changes

  • This change modifies an existing class/function/struct/type definition in a public C header file or Python module
  • This change removes an existing class/function/struct/type from a public C header file or Python module

Review Status

Closes #725 (closed)

Requires #728 (closed)

Edited by Karl Wette

Merge request reports