Skip to content

cmake: fix macro names for nodiscard/unreachable feature flags#385

Open
huven wants to merge 1 commit intoPJK:masterfrom
huven:fix-macro-names
Open

cmake: fix macro names for nodiscard/unreachable feature flags#385
huven wants to merge 1 commit intoPJK:masterfrom
huven:fix-macro-names

Conversation

@huven
Copy link

@huven huven commented Feb 5, 2026

Description

Fix CMake feature flag macro names to match the header checks.
CMake defined _CBOR_HAS_* while headers check CBOR_HAS_*, so the
feature flags for [[nodiscard]] and __builtin_unreachable() never
took effect. This aligns the definitions.

Checklist

  • I have read followed CONTRIBUTING.md
    • I have added tests
    • I have updated the documentation
    • I have updated the CHANGELOG
  • Are there any breaking changes?
    • If yes: I have marked them in the CHANGELOG (example)
  • Does this PR introduce any platform specific code?
  • Security: Does this PR potentially affect security?
  • Performance: Does this PR potentially affect performance?

CMake defined _CBOR_HAS_* while headers check CBOR_HAS_*, so the
feature flags never took effect. Align the CMake definitions with
the header checks.
@huven
Copy link
Author

huven commented Feb 5, 2026

The bazel test failure seems unrelated to this PR.

@huven
Copy link
Author

huven commented Feb 5, 2026

It’s Bazel 9 behavior: cc_test is no longer a native rule and must be loaded from cc:defs.bzl.

In examples/bazel/src/BUILD it’s used without being loaded, so Bazel errors out and then can’t find //src:hello.

I'll leave that to another PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant