[all-commits] [llvm/llvm-project] 53f303: [C99] Fix definitions of INTn_C macros (#133916)
Aaron Ballman via All-commits
all-commits at lists.llvm.org
Wed Apr 2 04:21:38 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 53f3031005f78b384845eaf770ec4aac54cae4c3
https://github.com/llvm/llvm-project/commit/53f3031005f78b384845eaf770ec4aac54cae4c3
Author: Aaron Ballman <aaron at aaronballman.com>
Date: 2025-04-02 (Wed, 02 Apr 2025)
Changed paths:
M clang/docs/ReleaseNotes.rst
M clang/lib/Headers/stdint.h
M clang/test/C/drs/dr209.c
M clang/test/Preprocessor/stdint.c
Log Message:
-----------
[C99] Fix definitions of INTn_C macros (#133916)
C99 introduced macros of the form `INTn_C(v)` which expand to a signed
or unsigned integer constant with the specified value `v` and the type
`int_leastN_t`. Clang's initial implementation of these macros used
token pasting to form the integer constants, but this means that users
cannot define a macro named `L`, `U`, `UL`, etc before including
`<stdint.h>` (in freestanding mode, where Clang's header is being used)
because that could form invalid token pasting results. The new
definitions now use the predefined `__INTn_C` macros instead of using
token pasting. This matches the behavior of GCC.
Fixes #85995
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list