This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/19239] Including stdlib.h ends up with macros major and minor being defined
- From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Wed, 03 Aug 2016 20:04:22 +0000
- Subject: [Bug libc/19239] Including stdlib.h ends up with macros major and minor being defined
- Auto-submitted: auto-generated
- References: <bug-19239-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=19239
--- Comment #5 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via dbab6577c6684c62bd2521c1c29dc25c3cac966f (commit)
via 63eb8df85a17f7f966d4daa4cf44c8e956636a86 (commit)
via cab4d74b01320670f57dcf356ff89256f4d2fc12 (commit)
from bf91be88ea90c1ea888d5646270d66363389ce96 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=dbab6577c6684c62bd2521c1c29dc25c3cac966f
commit dbab6577c6684c62bd2521c1c29dc25c3cac966f
Author: Zack Weinberg <zackw@panix.com>
Date: Tue May 10 11:07:42 2016 -0400
Deprecate inclusion of <sys/sysmacros.h> by <sys/types.h>
The macros defined by <sys/sysmacros.h> are not part of POSIX nor XSI, and
their names frequently collide with user code; see for instance glibc bug
19239 and Red Hat bug 130601. <stdlib.h> includes <sys/types.h> under
_GNU_SOURCE, and C++ code presently cannot avoid being compiled under
_GNU_SOURCE, exacerbating the problem.
* NEWS: Inclusion of <sys/sysmacros.h> by <sys/types.h> is deprecated.
* misc/sys/sysmacros.h: If __SYSMACROS_DEPRECATED_INCLUSION is defined,
define major, minor, and makedev to issue deprecation warnings on use.
If __SYSMACROS_DEPRECATED_INCLUSION is *not* defined, suppress
previously-activated deprecation warnings for these macros and prevent
subsequent inclusions of this header from having any effect.
* posix/sys/types.h: Define __SYSMACROS_DEPRECATED_INCLUSION before
including <sys/sysmacros.h>, and undefine it again afterward.
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=63eb8df85a17f7f966d4daa4cf44c8e956636a86
commit 63eb8df85a17f7f966d4daa4cf44c8e956636a86
Author: Zack Weinberg <zackw@panix.com>
Date: Thu Apr 28 12:29:55 2016 -0400
Minimize sysdeps code involved in defining major/minor/makedev.
Presently sys/sysmacros.h is entirely defined in sysdeps. This would
mean that the deprecation logic coming up in the next patch would have
to be written twice (in generic/ and unix/sysv/linux/). To avoid that,
hoist all but the unavoidably system-dependent logic to misc/, leaving a
bits/ header behind. This also promotes the Linux-specific encoding of
dev_t, which accommodates 32-bit major and minor numbers in a 64-bit dev_t,
to generic, as glibc's dev_t is always 64 bits wide.
The former Linux implementation used inline functions to avoid evaluating
arguments more than once. After this change, all platforms use inline
functions, which means that three new symbols are added to the generic ABI.
(These symbols are in the user namespace, which is how they have always
been on Linux. They begin with "gnu_dev_", so collisions with user code
are pretty unlikely.)
New ports henceforth need only provide a bits/sysmacros.h defining
internal macros __SYSMACROS_{DECLARE,DEFINE}_{MAJOR,MINOR,MAKEDEV}.
This is only necessary if the kernel encoding is incompatible with
the now-generic encoding (for instance, it would be necessary for
FreeBSD).
While I was at it, I added a basic round-trip test for these functions.
* sysdeps/generic/sys/sysmacros.h: Delete file.
* sysdeps/unix/sysv/linux/makedev.c: Delete file.
* sysdeps/unix/sysv/linux/sys/sysmacros.h: Move file ...
* bits/sysmacros.h: ... here; this encoding is now the generic
encoding. Now defines only the following macros:
__SYSMACROS_DECLARE_MAJOR, __SYSMACROS_DEFINE_MAJOR,
__SYSMACROS_DECLARE_MINOR, __SYSMACROS_DEFINE_MINOR,
__SYSMACROS_DECLARE_MAKEDEV, __SYSMACROS_DEFINE_MAKEDEV.
* misc/sys/sysmacros.h, misc/makedev.c: New files that use
bits/sysmacros.h and the above new macros to generate the
public implementations of major, minor, and makedev.
* misc/tst-makedev.c: New test.
* include/sys/sysmacros.h: New wrapper.
* misc/Makefile (headers): Add sys/sysmacros.h, bits/sysmacros.h.
(routines): Add makedev.
(tests): Add tst-makedev.
* misc/Versions [GLIBC_2.25]: Add gnu_dev_major, gnu_dev_minor,
gnu_dev_makedev.
* posix/Makefile (headers): Remove sys/sysmacros.h.
* sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove makedev.
* sysdeps/arm/nacl/libc.abilist: Add GLIBC_2.25,
gnu_dev_major, gnu_dev_makedev, gnu_dev_minor.
* sysdeps/unix/sysv/linux/aarch64/libc.abilist
* sysdeps/unix/sysv/linux/alpha/libc.abilist
* sysdeps/unix/sysv/linux/arm/libc.abilist
* sysdeps/unix/sysv/linux/hppa/libc.abilist
* sysdeps/unix/sysv/linux/i386/libc.abilist
* sysdeps/unix/sysv/linux/ia64/libc.abilist
* sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
* sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
* sysdeps/unix/sysv/linux/microblaze/libc.abilist
* sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
* sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
* sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
* sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
* sysdeps/unix/sysv/linux/nios2/libc.abilist
* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist
* sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
* sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
* sysdeps/unix/sysv/linux/sh/libc.abilist
* sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
* sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist
* sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist
* sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
* sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist:
Add GLIBC_2.25.
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=cab4d74b01320670f57dcf356ff89256f4d2fc12
commit cab4d74b01320670f57dcf356ff89256f4d2fc12
Author: Zack Weinberg <zackw@panix.com>
Date: Thu Apr 28 11:07:58 2016 -0400
Add utility macros for clang detection, and deprecation with messages.
There are three new macros added to features.h and sys/cdefs.h:
* __glibc_clang_prereq: just like __GNUC_PREREQ, but for clang.
* __glibc_clang_has_extension: wraps clang's intrinsic __has_extension.
Writing "#if defined __clang__ && __has_extension (...)" doesn't work,
because compilers other than clang will object to the unknown macro
__has_extension even though they don't need to evaluate it.
Instead, write "#if __glibc_clang_has_extension (...)".
* __attribute_deprecated_msg__(msg): like __attribute_deprecated__, but
if possible, prints a message.
The first two are used to define the third. The third will be used
in subsequent patches.
* include/features.h (__glibc_clang_prereq): New macro.
* misc/sys/cdefs.h (__glibc_clang_has_extension)
(__attribute_deprecated_msg__): New macros.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 73 ++++++++++++
NEWS | 10 ++
bits/sysmacros.h | 74 ++++++++++++
include/features.h | 19 +++-
include/sys/sysmacros.h | 1 +
misc/Makefile | 7 +-
misc/Versions | 3 +
misc/makedev.c | 30 +++++
misc/sys/cdefs.h | 22 ++++-
misc/sys/sysmacros.h | 120 ++++++++++++++++++++
misc/tst-makedev.c | 104 +++++++++++++++++
posix/Makefile | 2 +-
posix/sys/types.h | 8 +-
sysdeps/arm/nacl/libc.abilist | 5 +
sysdeps/generic/sys/sysmacros.h | 30 -----
sysdeps/unix/sysv/linux/Makefile | 2 +-
sysdeps/unix/sysv/linux/aarch64/libc.abilist | 1 +
sysdeps/unix/sysv/linux/alpha/libc.abilist | 1 +
sysdeps/unix/sysv/linux/arm/libc.abilist | 1 +
sysdeps/unix/sysv/linux/hppa/libc.abilist | 1 +
sysdeps/unix/sysv/linux/i386/libc.abilist | 1 +
sysdeps/unix/sysv/linux/ia64/libc.abilist | 1 +
sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist | 1 +
sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist | 1 +
sysdeps/unix/sysv/linux/makedev.c | 40 -------
sysdeps/unix/sysv/linux/microblaze/libc.abilist | 1 +
.../unix/sysv/linux/mips/mips32/fpu/libc.abilist | 1 +
.../unix/sysv/linux/mips/mips32/nofpu/libc.abilist | 1 +
.../unix/sysv/linux/mips/mips64/n32/libc.abilist | 1 +
.../unix/sysv/linux/mips/mips64/n64/libc.abilist | 1 +
sysdeps/unix/sysv/linux/nios2/libc.abilist | 1 +
.../sysv/linux/powerpc/powerpc32/fpu/libc.abilist | 1 +
.../linux/powerpc/powerpc32/nofpu/libc.abilist | 1 +
.../sysv/linux/powerpc/powerpc64/libc-le.abilist | 1 +
.../unix/sysv/linux/powerpc/powerpc64/libc.abilist | 1 +
sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist | 1 +
sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist | 1 +
sysdeps/unix/sysv/linux/sh/libc.abilist | 1 +
sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist | 1 +
sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist | 1 +
sysdeps/unix/sysv/linux/sys/sysmacros.h | 65 -----------
.../sysv/linux/tile/tilegx/tilegx32/libc.abilist | 1 +
.../sysv/linux/tile/tilegx/tilegx64/libc.abilist | 1 +
sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist | 1 +
sysdeps/unix/sysv/linux/x86_64/64/libc.abilist | 1 +
sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist | 1 +
46 files changed, 497 insertions(+), 146 deletions(-)
create mode 100644 bits/sysmacros.h
create mode 100644 include/sys/sysmacros.h
create mode 100644 misc/makedev.c
create mode 100644 misc/sys/sysmacros.h
create mode 100644 misc/tst-makedev.c
delete mode 100644 sysdeps/generic/sys/sysmacros.h
delete mode 100644 sysdeps/unix/sysv/linux/makedev.c
delete mode 100644 sysdeps/unix/sysv/linux/sys/sysmacros.h
--
You are receiving this mail because:
You are on the CC list for the bug.