[PATCH] endian.h: Define unsigned fixed-width integer types [BZ #31749]
Collin Funk
collin.funk1@gmail.com
Tue Jun 11 14:58:38 GMT 2024
Hi Joseph,
Joseph Myers <josmyers@redhat.com> writes:
> On Tue, 11 Jun 2024, Collin Funk wrote:
>
>> #if defined __USE_MISC && !defined __ASSEMBLER__
>> +/* Define uintN_t types. */
>> +#include <bits/stdint-uintn.h>
>> +
>
> __USE_MISC is not defined for any standard POSIX version.
>
> Do you know the _POSIX_C_SOURCE value in the 2024 edition of POSIX (the
> most recent version I have is the February draft, which still has it as
> 20yymmL; the HTML edition hasn't been published yet)?
No, I was using the February draft PDF as well. I checked <features.h>
and didn't see a definition so I just left it behind __USE_MISC for the
time being.
> *In this particular case*, since <endian.h> wasn't in any previous version
> of POSIX, we don't actually need those conditionals - we could just remove
> __USE_MISC conditions around everything defined for the header in the new
> POSIX version (making sure to adjust the spaces after "#" accordingly for
> the removed #if level), and define the types in question unconditionally.
Sounds good, I can submit a revised patch.
Is the !defined __ASSEMBLER__ safe to remove? It looks like perhaps
this header was at some point used in assembly code for constant macro
definitions without the functions. Not sure if this is still the case
or if it should be worried about.
Collin
More information about the Libc-alpha
mailing list