fix: replace std::from_chars with strtoul/strtoll for C++14 compatibi…#219
Merged
fix: replace std::from_chars with strtoul/strtoll for C++14 compatibi…#219
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…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:
Fixes: char_conv has no fallback for C++14 compilers (#216)