相关疑难解决方法(0)

如何获得POSIX strerror_r而不是GNU版本?

如何获取POSIX strerror_r而不是GNU版本?

我正在使用glibc 2.7版(基于其中的内容)在Ubuntu 8.04上使用g ++进行编译.

编辑

在上面的手册页中,它说:

glibc的功能测试宏要求(参见feature_test_macros(7)):

   The XSI-compliant version of strerror_r() is provided if:
   (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && ! _GNU_SOURCE
   Otherwise, the GNU-specific version is provided.
Run Code Online (Sandbox Code Playgroud)

然后在feature_test_macros(7)中说:

   If no feature test macros are explicitly defined, then the following feature
   test macros are defined by default: _BSD_SOURCE, _SVID_SOURCE, _POSIX_SOURCE,
   and _POSIX_C_SOURCE=200809L (200112L in glibc versions before 2.10; 199506L in
   glibc versions before 2.4; 199309L in glibc versions before 2.1).
Run Code Online (Sandbox Code Playgroud)

所以我应该得到POSIX版本,但我得到的是GNU版本.

ubuntu posix glibc g++

10
推荐指数
1
解决办法
4768
查看次数

标签 统计

g++ ×1

glibc ×1

posix ×1

ubuntu ×1