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 string/22290] New: XSI-compliant strerror_r unavailable in C++


https://sourceware.org/bugzilla/show_bug.cgi?id=22290

            Bug ID: 22290
           Summary: XSI-compliant strerror_r unavailable in C++
           Product: glibc
           Version: 2.23
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: string
          Assignee: unassigned at sourceware dot org
          Reporter: jwakely.gcc at gmail dot com
  Target Milestone: ---

The XSI-compliant strerror_r is provided if:

           (_POSIX_C_SOURCE >= 200112L) && !  _GNU_SOURCE
           Otherwise, the GNU-specific version is provided.

Because g++ automatically defines _GNU_SOURCE there's no way to get the XSI
version in C++ programs, except gross hacks before including any C++ standard
library headers:

#undef _GNU_SOURCE
#include <string.h>
#define _GNU_SOURCE 1
#include <mutex>

There might be no reasonable fix for this on the glibc side. G++ needs to stop
defining _GNU_SOURCE (see also PR 21326 and PR 21327).

-- 
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]