Repository navigation
Conversation
In C, char8_t comes from <uchar.h>, which glibc provides as of 2.36. GCC 15 defaults to C23, so NVTX_HAVE_CHAR8 was set on older glibc where the type does not exist, and nvtxExtPayloadTypeInfo.h failed to compile with 'char8_t' undeclared. Treat char8_t as unsupported there, as is already done for Apple and Cygwin. Signed-off-by: Bradley Dice <bdice@bradleydice.com>
bdice
force-pushed
the
fix-char8-glibc
branch
from
October 28, 2026 18:42
8b13538 to
b5bddec
Compare
This branch has not been deployed
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.
Fixes #188.
With GCC 15 (default C23) on glibc older than 2.36,
nvtxExtPayloadTypeInfo.hfails with'char8_t' undeclared. In C,char8_tcomes from<uchar.h>, which glibc only provides as of 2.36, butNVTX_HAVE_CHAR8was set for any C23 compile. ba4ec76 (the follow-up to #163) only changed the C++ detection.This excludes C23 on glibc < 2.36 from
NVTX_HAVE_CHAR8. The type is then reported as unsupported ({0, 0}), the same way it already is for Apple and Cygwin. C++ and non-glibc C libraries are unaffected.Testing
tests/built with-DCMAKE_C_STANDARD=23 -DCMAKE_CXX_STANDARD=20on glibc 2.43: 106/106 pass.coverage-ext-payload,payload-helper-macros-c) built against a glibc 2.34 sysroot with C23: fail with'char8_t' undeclaredondev, build with this change.nvtx3/nvToolsExtPayload.hwith GCC 15.3 at default-std: glibc 2.17, 2.28, 2.34 now compile withNVTX_HAVE_CHAR8 == 0; glibc 2.39 and 2.43 keepNVTX_HAVE_CHAR8 == 1. C++20 keepsNVTX_HAVE_CHAR8 == 1.#ifblock evaluated with__GLIBC__/__GLIBC_MINOR__set to 2.35 (0), 2.36 (1), 2.37 (1), 3.0 (1), 1.9 (0), and with no glibc defined (1).release-v3has the same header and the same problem, so this likely wants a backport there.