This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Use a proper C tokenizer to implement the obsolete typedefs test.
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Zack Weinberg <zackw at panix dot com>
- Cc: <libc-alpha at sourceware dot org>, Carlos O'Donell <carlos at redhat dot com>, Florian Weimer <fweimer at redhat dot com>, DJ Delorie <dj at redhat dot com>, Arjun Shankar <arjun at redhat dot com>
- Date: Mon, 21 Jan 2019 18:22:16 +0000
- Subject: Re: [PATCH] Use a proper C tokenizer to implement the obsolete typedefs test.
- References: <20190119164627.14259-1-zackw@panix.com>
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