Repository navigation
builtin,os: fix compiling V programs with latest clang 16 on windows (clang 16 is stricter than clang 14) - #19095
Merged
spytheman merged 1 commit intoAug 9, 2023
Conversation
…(clang 16 is stricter than clang 14)
metif12
added a commit
to metif12/v
that referenced
this pull request
Oct 10, 2026
An audit of the files this PR already touches found six constants in os_windows.c.v that nothing references. They were verified against the whole tree, including cmd/ and examples/. - format_message_argument_array, format_message_from_hmodule and format_message_from_string were orphaned when the FormatMessageW call in ptr_win_get_error_msg() dropped its argument array; dc4db87 renamed the group and only the three used flags kept callers. - sublang_default, and the sublang_neutral / lang_neutral pair, date from eef9b5f (vlang#19095). sublang_neutral is only read by lang_neutral, which nothing reads either, so the pair goes together. The three used flags (allocate_buffer, from_system, ignore_inserts) and max_error_code are kept. The s_* block lower in the file is deliberately present for -cross parity and is not touched, nor is add_vectored_exception_handler, which is exported. Note that builtin_windows.c.v carries its own mirrors of the three format_message flags; those are a different module and are left alone, so this does not disturb them. v fmt -verify is clean and v test vlib/os/os_test.c.v passes.
metif12
added a commit
to metif12/v
that referenced
this pull request
Oct 10, 2026
An audit of the files this PR already touches found six constants in os_windows.c.v that nothing references. They were verified against the whole tree, including cmd/ and examples/. - format_message_argument_array, format_message_from_hmodule and format_message_from_string were orphaned when the FormatMessageW call in ptr_win_get_error_msg() dropped its argument array; dc4db87 renamed the group and only the three used flags kept callers. - sublang_default, and the sublang_neutral / lang_neutral pair, date from eef9b5f (vlang#19095). sublang_neutral is only read by lang_neutral, which nothing reads either, so the pair goes together. The three used flags (allocate_buffer, from_system, ignore_inserts) and max_error_code are kept. The s_* block lower in the file is deliberately present for -cross parity and is not touched, nor is add_vectored_exception_handler, which is exported. Note that builtin_windows.c.v carries its own mirrors of the three format_message flags; those are a different module and are left alone, so this does not disturb them. v fmt -verify is clean and v test vlib/os/os_test.c.v passes.
medvednikov
added a commit
that referenced
this pull request
Oct 13, 2026
* os: drop the dead _utimbuf and sys/utime.h declarations Nothing has referenced them since #29911 replaced the last `_utime` call, so they only keep a header included that contributes nothing. `pub struct C._utimbuf` mirrors `<sys/utime.h>`'s struct, and `C._utime` was declared alongside it in the same place. Both are gone from the tree; the struct and the include were left behind. Verified by grep across `vlib/` and `cmd/` for `_utimbuf`, `C._utime` and `sys/utime`: all three are now unreferenced. `v fmt -verify` is clean, and `v test vlib/os/utime_windows_test.c.v`, which is master's own test for this function, still passes. * os: drop six more unused Windows constants An audit of the files this PR already touches found six constants in os_windows.c.v that nothing references. They were verified against the whole tree, including cmd/ and examples/. - format_message_argument_array, format_message_from_hmodule and format_message_from_string were orphaned when the FormatMessageW call in ptr_win_get_error_msg() dropped its argument array; dc4db87 renamed the group and only the three used flags kept callers. - sublang_default, and the sublang_neutral / lang_neutral pair, date from eef9b5f (#19095). sublang_neutral is only read by lang_neutral, which nothing reads either, so the pair goes together. The three used flags (allocate_buffer, from_system, ignore_inserts) and max_error_code are kept. The s_* block lower in the file is deliberately present for -cross parity and is not touched, nor is add_vectored_exception_handler, which is exported. Note that builtin_windows.c.v carries its own mirrors of the three format_message flags; those are a different module and are left alone, so this does not disturb them. v fmt -verify is clean and v test vlib/os/os_test.c.v passes. --------- Co-authored-by: Alexander Medvednikov <alexander@medvednikov.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.