Bug 1318878 - Per C11 and C++11, <stdint.h> should not look at __STDC_LIMIT_MACROS or __STDC_CONSTANT_MACROS
Summary: Per C11 and C++11, <stdint.h> should not look at __STDC_LIMIT_MACROS or __STD...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Developer Toolset
Classification: Red Hat
Component: gcc
Version: DTS 4.0 RHEL 7
Hardware: All
OS: Linux
unspecified
low
Target Milestone: rc
: 5.0
Assignee: Jakub Jelinek
QA Contact: Martin Cermak
URL:
Whiteboard:
Depends On: 1318877
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-18 03:03 UTC by Frank Hirtz
Modified: 2020-12-11 12:07 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1318877
Environment:
Last Closed: 2018-01-30 14:50:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Sourceware 15366 0 None None None 2016-03-18 03:03:11 UTC

Description Frank Hirtz 2016-03-18 03:03:11 UTC
+++ This bug was initially created as a clone of Bug #1318877 +++

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.17-106.el7_2.4

Comment 1 Carlos O'Donell 2016-03-20 14:41:09 UTC
See comment here: https://bugzilla.redhat.com/show_bug.cgi?id=1318877#c1

Switching to Developer Toolset.


Note You need to log in before you can comment on or make changes to this bug.