[PATCH] Use a proper C tokenizer to implement the obsolete typedefs test.

Joseph Myers joseph@codesourcery.com
Mon Jan 21 18:22:00 GMT 2019


On Sat, 19 Jan 2019, Zack Weinberg wrote:

> It is also feasible to make the new test understand the difference
> between _defining_ the obsolete typedefs and _using_ the obsolete
> typedefs, which means posix/{bits,sys}/types.h no longer need to be
> exempted.  This uncovered an actual bug in bits/types.h: __quad_t and
> __u_quad_t were being used to define __S64_TYPE, __U64_TYPE,
> __SQUAD_TYPE and __UQUAD_TYPE.  These are changed to __int64_t and
> __uint64_t respectively.  (__SQUAD_TYPE and __UQUAD_TYPE should be
> considered obsolete as well, but that is more of a change than I feel
> is safe during the freeze.  Note that the comments in bits/types.h
> claiming a difference between *QUAD_TYPE and *64_TYPE were also in
> error: supposedly QUAD_TYPE is ‘long long’ in all ABIs whereas 64_TYPE
> is ‘long’ in LP64 ABIs, but that appears never to have been true; both
> are defined as ‘long’ in LP64 ABIs.  I made a minimal change to make
> the comments not completely wrong and will revisit this whole area for
> the next release.)

Note that theoretically this could affect semantics (__int64_t is 
explicitly signed, __quad_t only implicitly so, so with 
-funsigned-bitfields __quad_t bit-fields would be unsigned but __int64_t 
bit-fields would always be signed).  I think such a change is a good 
thing, and reasonably safe even at the present development stage (and 
generally typedefs that are implicitly signed should best be made 
explicitly signed to avoid such variations with -funsigned-bitfields), but 
it is still a possible semantic difference.

This is not a review of the patch.

-- 
Joseph S. Myers
joseph@codesourcery.com


More information about the Libc-alpha mailing list