This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2] Deprecate inclusion of sys/sysmacros.h by sys/types.h.

On Mon, Apr 25, 2016 at 3:24 AM, Florian Weimer <> wrote:
> On 11/19/2015 05:11 AM, Zack Weinberg wrote:
>>          * misc/Versions [GLIBC_2.24]: Add gnu_dev_major, gnu_dev_minor,
>>          and gnu_dev_makedev.
> Why do we need these new functions?  Recent GCC has support for emitting
> warnings from macros, if that's what you need.

I should maybe split the patch again to make clearer what is going on.
These functions exist already for Linux-based configurations; I promoted
them to generic so that the new bits/sysmacros.h could contain only the
minimum amount of system-specific logic.

The functions are *needed* because the Linux kernel encoding of dev_t
values is complicated.  Pure macro implementations of major, minor,
makedev could only avoid evaluating their arguments multiple times by
resorting to the ({ ... }) extension, which is no good for a header
that has to work with any compiler.  Instead, the original author of
sysdeps/.../linux/sys/sysmacros.h went for inline functions, with
out-of-line fallbacks in case inlining is suppressed or unavailable.
I imagine we wouldn't name those functions gnu_dev_(major|minor|makedev)
nowadays, but they're in the ABI already.

I shall look into the warnings-from-macros feature; maybe it will get
me out of having to use __REDIRECT.

>>          * misc/sys/cdefs.h: Add __attribute_deprecated_msg__, wrapping
>>          GCC >=4.5's ability to specify a detailed deprecation message.
> That should probably go into a separate patch.

Do you think it can be lumped with the addition of __clang_has_extension,
or should each of those be separate patches?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]