Skip to content

fix: replace std::from_chars with strtoul/strtoll for C++14 compatibi…#219

Merged
zlatinski merged 1 commit intomainfrom
remove-from_chars
Mar 30, 2026
Merged

fix: replace std::from_chars with strtoul/strtoll for C++14 compatibi…#219
zlatinski merged 1 commit intomainfrom
remove-from_chars

Conversation

@zlatinski
Copy link
Copy Markdown
Contributor

…lity

Revert the C++17 std::from_chars dependency introduced in e2d5466. The header requires C++17 and breaks builds on older compilers (GCC < 8, Clang < 7) and distros with C++14-only toolchains.

Replace all std::from_chars usage with strtoul/strtoll/strtol/strtod from , which are C standard library functions available on all platforms and C++ standards.

The original glibc 2.38 portability issue (GCC 14 redirecting sscanf/ strtol to _isoc23* symbols) does not affect strtoul/strtoll — these are stable C library symbols present in all glibc versions.

Files changed:

  • VkEncoderConfig.cpp: parseUint/parseInt/parseFloat/parseHex rewritten with strtoull/strtoll/strtod/strtoul
  • VkEncoderConfig.h: ParseY4mInt uses strtoul
  • VkEncoderConfigH264.cpp: --slices parsing uses strtol
  • VkEncoderConfigH265.cpp: --slices parsing uses strtol
  • VkEncoderConfigAV1.cpp: READ_PARAM macro uses strtoll
  • DecoderConfig.h: --deviceID and --crcInitValue use strtoul
  • Helpers.h: UUID hex byte parsing uses strtoul

Fixes: char_conv has no fallback for C++14 compilers (#216)

…lity

Revert the C++17 std::from_chars dependency introduced in e2d5466.
The <charconv> header requires C++17 and breaks builds on older
compilers (GCC < 8, Clang < 7) and distros with C++14-only toolchains.

Replace all std::from_chars usage with strtoul/strtoll/strtol/strtod
from <cstdlib>, which are C standard library functions available on
all platforms and C++ standards.

The original glibc 2.38 portability issue (GCC 14 redirecting sscanf/
strtol to __isoc23_* symbols) does not affect strtoul/strtoll — these
are stable C library symbols present in all glibc versions.

Files changed:
- VkEncoderConfig.cpp: parseUint/parseInt/parseFloat/parseHex rewritten
  with strtoull/strtoll/strtod/strtoul
- VkEncoderConfig.h: ParseY4mInt uses strtoul
- VkEncoderConfigH264.cpp: --slices parsing uses strtol
- VkEncoderConfigH265.cpp: --slices parsing uses strtol
- VkEncoderConfigAV1.cpp: READ_PARAM macro uses strtoll
- DecoderConfig.h: --deviceID and --crcInitValue use strtoul
- Helpers.h: UUID hex byte parsing uses strtoul

Fixes: char_conv has no fallback for C++14 compilers (#216)

Signed-off-by: Tony Zlatinski <tzlatinski@nvidia.com>
@zlatinski zlatinski merged commit 387e919 into main Mar 30, 2026
7 checks passed
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