Skip to content

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 into
vlang:masterfrom
spytheman:builtin_fix_compilation_with_clang16_on_windows
Aug 9, 2023
Merged

spytheman merged 1 commit into
vlang:masterfrom
spytheman:builtin_fix_compilation_with_clang16_on_windows

Conversation

@spytheman

Copy link
Copy Markdown
Contributor

No description provided.

@spytheman
spytheman merged commit eef9b5f into vlang:master Aug 9, 2023
@spytheman
spytheman deleted the builtin_fix_compilation_with_clang16_on_windows branch August 9, 2023 12:04
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>
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