This is the mail archive of the glibc-bugs@sourceware.org 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]

[Bug libc/15366] New: Per C11 and C++11, <stdint.h> should not look at __STDC_LIMIT_MACROS or __STDC_CONSTANT_MACROS


http://sourceware.org/bugzilla/show_bug.cgi?id=15366

             Bug #: 15366
           Summary: Per C11 and C++11, <stdint.h> should not look at
                    __STDC_LIMIT_MACROS or __STDC_CONSTANT_MACROS
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: unassigned@sourceware.org
        ReportedBy: richard@metafoo.co.uk
                CC: drepper.fsp@gmail.com
    Classification: Unclassified


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.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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