Red Hat Bugzilla – Bug 1318877
Per C11 and C++11, <stdint.h> should not look at __STDC_LIMIT_MACROS or __STDC_CONSTANT_MACROS
Last modified: 2017-08-01 14:06:55 EDT
Description of problem: A client requested that we backport the following header fix: <snip> glibc's <stdint.h> follows C99, which says that in C++, certain macros should only be defined if __STDC_LIMIT_MACROS or __STDC_CONSTANT_MACROS is defined. However, the C++ committee decided that they didn't want this behavior, and explicitly overruled this in the C++11 standard (the first to provide <stdint.h>). Consequently C11 removed these rules. glibc has not been updated to follow the C11 rules, and still checks for those macros being defined in C++ mode. C++ implementations are currently working around this by wrapping glibc's <stdint.h> with one which defines these macros first. These workarounds should not be necessary; glibc should simply not be checking for these macros. Fix would be to remove these lines from sysdeps/generic/stdint.h: /* The ISO C99 standard specifies that in C++ implementations these macros should only be defined if explicitly requested. */ #if !defined __cplusplus || defined __STDC_LIMIT_MACROS ... plus the corresponding #endif and the corresponding lines for __STDC_CONSTANT_MACROS. </snip> Reference: https://sourceware.org/bugzilla/show_bug.cgi?id=15366 Version-Release number of selected component (if applicable): glibc-headers-2.12-1.166.el6_7.7.x86_64
The support for C11 and C++11 is only experimental in the RHEL 7 system compiler and runtimes, and there is no support for it in the RHEL 6 runtimes as far as I know. Developer Toolset provides C11 and C++11 support in RHEL 7 and RHEL6, I'll switch the componet there and ask them for their opinion on how to fix this. It might be that we conclude the changes are low enough risk in RHEL6 that we might change the core runtime headers, but my feeling is that this may be unacceptable as RHEL6 is now in Production Phase 2. The fix will therefore have to be contained entirely in Developer Toolset.
The changes are unacceptable from a risk perspective for RHEL6 Production Phase 2. The changes are acceptable for glibc in RHEL7, so we'll look at these for rhel-7.4. This would enable the use of DTS for compiling C11, but not the system compiler.
I meant rather than say removing the -/* The ISO C99 standard specifies that in C++ implementations these - macros should only be defined if explicitly requested. */ -#if !defined __cplusplus || defined __STDC_LIMIT_MACROS - stuff change it to: /* The ISO C99 standard specifies that in C++ implementations these macros should only be defined if explicitly requested. */ #if !defined __cplusplus || defined __STDC_LIMIT_MACROS || __GNUC_PREREQ (5, 0) or something similar. That should not be that risky even for older RHELs.
(In reply to Jakub Jelinek from comment #5) > I meant rather than say removing the > -/* The ISO C99 standard specifies that in C++ implementations these > - macros should only be defined if explicitly requested. */ > -#if !defined __cplusplus || defined __STDC_LIMIT_MACROS > - > stuff change it to: > /* The ISO C99 standard specifies that in C++ implementations these > macros should only be defined if explicitly requested. */ > #if !defined __cplusplus || defined __STDC_LIMIT_MACROS || __GNUC_PREREQ (5, > 0) > or something similar. That should not be that risky even for older RHELs. That might be workable for older RHEL. Again my worry is that there are people already using gcc 5.x on RHEL6, perhaps their own compiler, and changing glibc would change the behaviour that they are seeing from the core runtimes. In a production phase 2 release like RHEL 6.9 we don't want to change anything that anyone might already be expecting to behave a certain way. While in RHEL 7.3 and 7.4 we have much more tolerance to this kind of change.
Upstream: commit 1ef74943ce2f114c78b215af57c2ccc72ccdb0b7 Author: Paul Pluzhnikov <ppluzhnikov@google.com> Date: Thu Apr 25 11:08:31 2013 -0700 Get rid of __STDC_FORMAT_MACROS, __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2017:1916