public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* RFC: remove <sys/sysmacros.h> from <sys/types.h>
@ 2015-11-13 14:21 Zack Weinberg
  2015-11-13 14:29 ` Zack Weinberg
                   ` (4 more replies)
  0 siblings, 5 replies; 29+ messages in thread
From: Zack Weinberg @ 2015-11-13 14:21 UTC (permalink / raw)
  To: GNU C Library

sys/sysmacros.h defines three macros - major, minor, makedev - that
are likely to collide with user symbols.  That would be fine, since
it's off by itself, but sys/types.h includes sys/sysmacros.h under
__USE_BSD, which means anyone who defines _BSD_SOURCE or _GNU_SOURCE
and includes sys/types.h gets the macros.  Moreover, under _GNU_SOURCE
stdlib.h includes sys/types.h, and g++ defines _GNU_SOURCE by default
(this is agreed to be suboptimal, but apparently libstdc++'s headers
need it).  This all adds up to what might not technically be a
conformance violation but sure *looks* like it from the end-user
perspective.

At least two bug reports have been filed on this behavior:
https://sourceware.org/bugzilla/show_bug.cgi?id=19239 and
https://bugzilla.redhat.com/show_bug.cgi?id=130601 .

These macros are potentially relevant to anything that wants to take
apart an st_dev value in detail, but I have not personally encountered
a piece of software that needs them in many years.  Since sys/types.h
does not provide these macros on SysV-derived systems, I would expect
that portable software that needs them is prepared to include
sys/sysmacros.h itself.

Therefore, I propose we remove the inclusion of sys/sysmacros.h from
sys/types.h.  It's risky enough that I think it's worth doing a distro
rebuild with that change to find out what, if anything, breaks - who
do I talk to to make that happen?

zw

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2016-04-21 21:11 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-13 14:21 RFC: remove <sys/sysmacros.h> from <sys/types.h> Zack Weinberg
2015-11-13 14:29 ` Zack Weinberg
2015-11-13 14:45 ` Dmitry V. Levin
2015-11-13 15:59   ` Paul Eggert
2015-11-13 23:43 ` Roland McGrath
2015-11-14  9:18   ` Andreas Schwab
2015-11-14 20:41     ` Zack Weinberg
2015-11-14 21:59       ` Rich Felker
2015-11-14 22:19         ` Andreas Schwab
2015-11-21  0:19           ` Roland McGrath
2015-11-21  0:56             ` Zack Weinberg
2015-11-14 20:19 ` Carlos O'Donell
2015-11-19  4:13 ` RFC: deprecate sys/sysmacros.h inclusion from sys/types.h Zack Weinberg
2015-12-07 14:03   ` Zack Weinberg
2015-12-21 20:31     ` Zack Weinberg
2016-01-11 15:16       ` Zack Weinberg
2016-01-11 15:27         ` Carlos O'Donell
2016-01-11 18:02           ` Zack Weinberg
2016-01-11 20:50             ` Carlos O'Donell
2015-12-29 20:42   ` Mike Frysinger
2015-12-29 21:56     ` Zack Weinberg
2015-12-29 22:45       ` Mike Frysinger
2016-02-19 20:56         ` Mike Frysinger
2016-04-20 17:37   ` Mike Frysinger
2016-04-20 17:58     ` Zack Weinberg
2016-04-20 18:11       ` Mike Frysinger
2016-04-21 19:31   ` Roland McGrath
2016-04-21 21:00     ` Zack Weinberg
2016-04-21 21:11       ` Roland McGrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).