Commit 3114651
Update microsoft_gsl from v4.0.0 to v4.2.1 (fixes C4875 deprecation) (#28527)
### Description
Upgrades `microsoft_gsl` to v4.2.1 and patches `GSL_SUPPRESS` to
stringify its argument for MSVC, fixing the C4875 deprecation warning in
VC++ 18.6.0.
- **`cmake/deps.txt`** — Bump to v4.2.1
- **`cmake/patches/gsl/1064.patch`** — Removed; the NVCC guard
(`!defined(__NVCC__)`) is already upstream in v4.2.1
- **`cmake/patches/gsl/1213.patch`** — New patch: `[[gsl::suppress(x)]]`
→ `[[gsl::suppress(#x)]]` for MSVC, matching upstream
microsoft/GSL@543d0dd (PR microsoft/GSL#1213)
- **`cmake/external/onnxruntime_external_deps.cmake`** — Removed the
`if(onnxruntime_USE_CUDA)` conditional around the patch; the stringify
fix applies to all MSVC builds, not just CUDA
- **`cmake/vcpkg.json`** — Added `"version>=": "4.2.1"` constraint for
`ms-gsl` to ensure vcpkg builds also pick up a version that includes the
NVCC guard fix
### Motivation and Context
GSL v4.0.0's `GSL_SUPPRESS` macro passes a non-string-literal to
`[[gsl::suppress()]]`. VC++ 18.6.0 deprecates this form (C4875), and a
future MSVC release will remove it entirely, breaking the build. The
warning fires on essentially every translation unit via `capture.h` /
`narrow.h`.
The upstream fix (stringify via `#x`) hasn't shipped in a GSL release
yet, so a local patch is still needed until a future GSL release
includes it.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com>
Co-authored-by: Tianlei Wu <tlwu@microsoft.com>1 parent df44eab commit 3114651
5 files changed
Lines changed: 28 additions & 46 deletions
File tree
- cmake
- external
- patches/gsl
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
426 | 418 | | |
427 | 419 | | |
428 | 420 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
| |||
0 commit comments