This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: RFC: deprecate sys/sysmacros.h inclusion from sys/types.h
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Zack Weinberg <zackw at panix dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 21 Apr 2016 14:11:39 -0700 (PDT)
- Subject: Re: RFC: deprecate sys/sysmacros.h inclusion from sys/types.h
- Authentication-results: sourceware.org; auth=none
- References: <564D4C62 dot 3090404 at panix dot com> <20160421193125 dot EC9C42C3B00 at topped-with-meat dot com> <CAKCAbMjnDDU1LHk5uKWPansYTbpSpsg9KEXj+Rdqs96jPpVREw at mail dot gmail dot com>
> Hmm, good point. The macro was for programs that *are* being broken
> because they didn't expect sys/types.h to define major/minor/makedev,
> and advising such programs to #undef those symbols is better advice,
> since that will work on *BSDs that still define them there.
Yes, that is harmless now and will be harmless in the future and does not
look like gratuitous cruft in the same way.
> >> +#ifdef __USE_EXTERN_INLINES
> >> +#define __SYSMACRO_IMPL(rtype, name, proto, expr) \
> >
> > An example of unintended preprocessor directives.
>
> I assume you meant unindented.
Indeed. Typing is hard.
> > Also, make all these macros __SYSMACROS_* instead of _SYSMACRO_* (so
> > the prefix matches the name of the header file).
>
> I think singular is more appropriate because it expands to the
> implementation of *one* sysmacro.
"sysmacro" is not a thing. "sysmacros" is the name of the file, and hence
the moniker for its private namespace.