-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add AVR __[u]int24 to type_traits #37
Conversation
Why are these not already enabled as That's how non-standard integer types are supposed to be supported, and how it works for other targets. |
It didn't work for me when I tried to use type_traits on these types with
avr-g++ 14.2.
…--
Kevin Thibedeau
On Sun, Dec 29, 2024 at 7:18 PM Jonathan Wakely ***@***.***> wrote:
Why are these not already enabled as __GLIBCXX_TYPE_INT_N_1 ?
That's how non-standard integer types are supposed to be supported, and
how it works for other targets.
—
Reply to this email directly, view it on GitHub
<#37 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABTTUQ4YSITNXMGW2PTXCLD2ICGLXAVCNFSM6AAAAABULG4O5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNRUHA4DANJXHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
If avr-g++ supports those types, then it should define the macros to tell libstdc++ that it supports them. Then everything in the library will just work. |
This test program fails to compile with the existing code. It works fine with standard integer types:
|
I think a better fix would be to add this to #if defined(__INT24_MAX__) && !defined(__GLIBCXX_TYPE_INT_N_0)
# define __GLIBCXX_TYPE_INT_N_0 __int24
# define __GLIBCXX_BITSIZE_INT_N_0 24
#endif This will make all the type traits and other metaprogramming utilities work for I'll file an upstream GCC bug to get those macros implicitly defined by the compiler, which is how it's supposed to work. Edit: filed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118329 |
This is the best solution. Thanks for digging into the problem. |
The GCC avr maintainer has fixed this for GCC 14.3: |
Support the 24-bit integer types
__int24
and__uint24
in type_traits.