Date: Sat, 14 Aug 2021 01:25:09 +0000 From: bugzilla-noreply@freebsd.org To: standards@FreeBSD.org Subject: [Bug 257827] Providing _POSIX_C_SOURCE causes some C++ headers to fail Message-ID: <bug-257827-99-wEoHoQBdhp@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-257827-99@https.bugs.freebsd.org/bugzilla/> References: <bug-257827-99@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D257827 --- Comment #2 from Chris Spiegel <cspiegel@gmail.com> --- If _POSIX_C_SOURCE is invalid for C++, then agreed, this whole bug is inval= id. Moreover, given that _XOPEN_SOURCE includes _POSIX_C_SOURCE (i.e. if you de= fine _XOPEN_SOURCE it's equivalent to defining the corresponding _POSIX_C_SOURCE= ), it seems that neither of these can/should be set while using C++. Just for some information, I found that Oracle's Solaris posix(5) man page = says this: "C++ bindings are not defined for POSIX or X/Open CAE, so specifying feature test macros such as _POSIX_SOURCE, _POSIX_C_SOURCE, and _XOPEN_SOURCE can result in compilation errors due to conflicting requirements of standard C++ and those specifications." (https://docs.oracle.com/cd/E86824_01/html/E54776/posix-5.html) Does all of this imply that it's invalid to call POSIX code from C++? On FreeBSD, at least, it "works" just fine if you define _XOPEN_SOURCE for C++, but of course that might be incidental, given that _POSIX_C_SOURCE alone ca= uses this failure (it's valid in general to ask for POSIX support without the XSI extension, e.g. to defined only _POSIX_C_SOURCE). --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-257827-99-wEoHoQBdhp>