Skip to content

Conversation

@Rainyan
Copy link
Collaborator

@Rainyan Rainyan commented Dec 3, 2025

Description

  • Fix all compiler warnings for MSVC and the compilers in Steam Runtime SDK versions 3 and 4
  • Turns warnings into errors

Toolchain

The following compilers are documented as "supported" in CONTRIBUTING.md by this PR, and they've been confirmed to not emit any warnings in release nor debug presets:

  • Windows MSVC v143 - VS 2022 C++ x64/x86 build tools (Latest)
  • Windows MSVC version used by the latest windows-2025 CI runner image (Microsoft.VisualStudio.Component.VC.Tools.x86.x64)
  • Linux GCC 10 steamrt3 'sniper' (currently used for Linux CI builds)
  • Linux GCC 14 steamrt3 'sniper'
  • Linux Clang 11 steamrt3 'sniper' wontfix: compile issues with c++20 stdlib includes
  • Linux GCC 14 steamrt4
  • Linux Clang 19 steamrt4

I decided to drop support for the problematic Clang compiler in the steamrt3 container, because it's over 5 years old and unlikely to get patches or backports anymore. If you want to use Clang, see the steamrt4 option for it, instead.

Of the list above, the compilers currently used by the GitHub CI builds are:

  • The windows-2025 runner image version of MSVC for Windows
  • The GCC 10 steamrt3 inside the 'sniper' container for Linux

While we don't use steamrt4 yet, support for it was included to make the migration smoother in the future, either to GCC 14 or Clang 19.

The Windows runner image is not currently pinnable, so sporadic breakage is possible. The Linux steamrt container could be pinned; we're currently using sniper/sdk:latest but as it seems rather stable, pinning is probably not necessary for now. Some safeguards have been implemented by this PR as documented, such as disabling warnings-as-errors for tagged release builds, to minimize breakage from unexpected build environment changes.

Additionally, the following compilers were verified to not emit any warnings, although not going to "officially" maintain support for them:

  • Linux GCC 11.4.0-1ubuntu1~22.04.2
  • Linux Clang 14.0.0-1ubuntu1.1
  • Linux GCC 16-20251221 Snapshot (latest as of 2025/12/28)
  • TODO Linux Clang 21.1.0 (latest as of 2025/12/28)

Linked Issues

@Rainyan Rainyan force-pushed the refactor branch 3 times, most recently from f27beda to a3a3bec Compare December 3, 2025 22:27
@DESTROYGIRL DESTROYGIRL added the Build System CMake and other build-related stuff label Dec 9, 2025
@Rainyan Rainyan force-pushed the refactor branch 12 times, most recently from c7ae089 to bb7623b Compare December 18, 2025 23:08
@Rainyan Rainyan force-pushed the refactor branch 14 times, most recently from e50b2ac to d76eb6d Compare December 25, 2025 14:16
The memory is technically properly allocated in the reentrant
pReturn->ConvertToCopiedData() call in the vscript binding macros,
but as the reference goes out of scope it could technically blow up.

This change makes g++-14 (SteamRT 14.2.0-19~steamrt3.1+bsrt3.1) 14.2.0
happy for the release build with -Wall
g++-14 (SteamRT 14.2.0-19~steamrt3.1+bsrt3.1) 14.2.0
```
error: ignoring return value of ‘char* getcwd(char*, size_t)’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
  281 |                 _getcwd( szCwd, sizeof( szCwd ) );
```
Soft-pin the image name to Windows Server 2025 to avoid breakage if/when the latest tag starts pointing to a newer image.
sizeof(unsigned long) is not guaranteed to equal sizeof(int); while this
technically doesn't matter since the punned value is truncated to sizeof
the destination, this would break the sizeof equality assert in our
pun(...) helper func for such a case.
@Rainyan Rainyan force-pushed the refactor branch 2 times, most recently from 55f62a3 to 924756b Compare December 28, 2025 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build System CMake and other build-related stuff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants