Describe the issue
cmake/deps.txt pins microsoft_gsl to v4.0.0, whose GSL_SUPPRESS macro expands to a [[gsl::suppress(<identifier>)]] attribute with a non-string-literal argument. Visual C++ 18.6.0 deprecates that form and emits warning C4875:
include/onnxruntime/core/common/logging/capture.h(80): warning C4875: a non-string literal argument to [[gsl::suppress]] is deprecated and will be removed in a future release.
The warning fires on every translation unit that transitively includes core/common/logging/capture.h or core/common/narrow.h, which is essentially every file in the build. When MSVC follows through and removes the form, this will break the build outright.
Upstream microsoft/GSL has already fixed this
microsoft/GSL@543d0dd ("export proper syntax for GSL_SUPPRESS for new VS", PR #1213) updates the macro to stringify its argument via #x for clang and newer MSVC:
#define GSL_SUPPRESS(x) [[gsl::suppress(#x)]]
That fix is available in GSL v4.1.0 (October 2024) and later. The current latest is v4.2.1 (December 2025).
Describe the issue
cmake/deps.txtpinsmicrosoft_gslto v4.0.0, whoseGSL_SUPPRESSmacro expands to a[[gsl::suppress(<identifier>)]]attribute with a non-string-literal argument. Visual C++ 18.6.0 deprecates that form and emits warning C4875:The warning fires on every translation unit that transitively includes
core/common/logging/capture.horcore/common/narrow.h, which is essentially every file in the build. When MSVC follows through and removes the form, this will break the build outright.Upstream microsoft/GSL has already fixed this
microsoft/GSL@543d0dd ("export proper syntax for GSL_SUPPRESS for new VS", PR #1213) updates the macro to stringify its argument via
#xfor clang and newer MSVC:That fix is available in GSL v4.1.0 (October 2024) and later. The current latest is v4.2.1 (December 2025).