Skip to content

libutil: More robust check for NIX_UBSAN_ENABLED#15273

Merged
Ericson2314 merged 1 commit intomasterfrom
more-robust-ubsan-macro
Feb 18, 2026
Merged

libutil: More robust check for NIX_UBSAN_ENABLED#15273
Ericson2314 merged 1 commit intomasterfrom
more-robust-ubsan-macro

Conversation

@xokdvium
Copy link
Contributor

@xokdvium xokdvium commented Feb 17, 2026

Motivation

In 3df91be I forgot that the header
might get included out-of-tree with -Wundef. Let's make this a public
config option for libutil as it can affect function bodies in headers.

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@xokdvium xokdvium requested a review from edolstra as a code owner February 17, 2026 16:18
@Ericson2314
Copy link
Member

I dunno if this is good? Because this makes it worse in the case where we do make undefined variables an error, because it means if we mess up the meson later and forgot to define the variable, we wouldn't notice in the header?

@xokdvium
Copy link
Contributor Author

There's still a check - that's why I've added it to error.cc. We do in fact make undefined macros an error and that will catch it. I just wanted to make sure that we don't impose this on out-of-tree users.

@xokdvium xokdvium requested a review from Ericson2314 February 18, 2026 08:29
In 3df91be I forgot that the header
might get included out-of-tree with -Wundef. Let's make this a public
config option for libutil as it can affect function bodies in headers.
@xokdvium xokdvium force-pushed the more-robust-ubsan-macro branch from fc06e83 to db853cf Compare February 18, 2026 14:34
@Ericson2314 Ericson2314 added this pull request to the merge queue Feb 18, 2026
Merged via the queue into master with commit 96bcf59 Feb 18, 2026
30 of 31 checks passed
@Ericson2314 Ericson2314 deleted the more-robust-ubsan-macro branch February 18, 2026 17:08
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.

2 participants