Skip to content

Conversation

@mstorsjo
Copy link
Contributor

@mstorsjo mstorsjo commented Jan 4, 2026

If doing cc.get_define() with MSVC, for a symbol that isn't defined, then get_define() can end up returning sentinel_undef with a trailing space, as an actual defined string.

This happens if MSVC is called with -std:c11 (or -Zc:preprocessor, to opt in to the newer, standards conformant preprocessor mode) and the test source file is written with Unix newlines.

(This is observed if cross compiling with MSVC wrapped in Wine on Unix, but probably would appear the same if Meson was running in Cygwin/msys2 Python as well.)

This issue has been reported upstream to MSVC at [1].

[1] https://developercommunity.visualstudio.com/t/Inconsistent-whitespace-with-standard-pr/11023343

If doing cc.get_define() with MSVC, for a symbol that isn't
defined, then get_define() can end up returning sentinel_undef
with a trailing space, as an actual defined string.

This happens if MSVC is called with -std:c11 (or -Zc:preprocessor,
to opt in to the newer, standards conformant preprocessor mode) and
the test source file is written with Unix newlines.

(This is observed if cross compiling with MSVC wrapped in Wine on
Unix, but probably would appear the same if Meson was running in
Cygwin/msys2 Python as well.)

This issue has been reported upstream to MSVC at [1].

[1] https://developercommunity.visualstudio.com/t/Inconsistent-whitespace-with-standard-pr/11023343
@mstorsjo mstorsjo requested a review from dcbaker as a code owner January 4, 2026 22:54
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