Skip to content

fix, H5CPP_supported_elementary_types redefined with conflicting values (~50 build warnings) #289

@steven-varga

Description

@steven-varga

Symptom

~50 build warnings (one per TU that includes h5cpp/core):

h5cpp/H5Tmeta.hpp:30:9: warning: "H5CPP_supported_elementary_types" redefined
h5cpp/H5misc.hpp:22:9: note: this is the location of the previous definition

Root cause

The macro is #defined twice with different replacement lists, and both headers are pulled in by h5cpp/core (H5misc at core:36, H5Tmeta at core:39):

  • H5misc.hpp:22 — current, includes enum:
    "… ::= pod_struct | enum | float | double | [signed](int8 | int16 | int32 | int64)"
  • H5Tmeta.hpp:30 — stale, marked //FIXME: move it elsewhere, missing enum.

Because core includes H5Tmeta last, the stale (no-enum) string currently wins, which is also wrong: enums are supported (see the explanatory comment under H5misc.hpp:22). The macro is only used in static_assert diagnostics in H5Dread.hpp:39 / H5Dwrite.hpp:80, both of which always include H5misc via core — so the H5Tmeta copy is redundant.

Fix

Remove the stale duplicate define (and its FIXME comment) from H5Tmeta.hpp; keep the single canonical definition in H5misc.hpp.

Acceptance

  • Clean build, zero H5CPP_supported_elementary_types redefined warnings.
  • Diagnostic string reflects enum support.

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