[PATCH 1/7] Fix __PTHREAD_MUTEX_HAVE_ELISION -Wundef warning
Joseph S. Myers
joseph@codesourcery.com
Thu Mar 20 18:31:00 GMT 2014
On Thu, 20 Mar 2014, Roland McGrath wrote:
> > Typo-proofing also provides another case for replacing the __need_*
> > scheme, as I suggested in
> > <https://sourceware.org/ml/libc-alpha/2012-08/msg00510.html> and
> > <https://sourceware.org/ml/libc-alpha/2012-11/msg00045.html>, so that we
> > do
> >
> > #include <bits/time_t.h>
> >
> > instead of
> >
> > #define __need_time_t
> > #include <time.h>
> >
> > (the former being typo-proof, the latter not).
>
> I didn't recall you suggesting that, but it's been on my list for some
> time. (I think we should use a convention other than plain bits/, but
> that's just trivia.)
Note that for the cases of
#define __need_size_t
#include <stddef.h>
and other cases involving stddef.h, an improvement would require new
separate headers to be installed by GCC, so that glibc's header for size_t
could do
#if __GNUC_PREREQ (whatever)
# include <gcc-size_t.h>
#else
# define __need_size_t
# include <stddef.h>
#endif
or similar.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list