[Bug libc/19029] New: _XOPEN_VERSION and _XOPEN_UNIX not defined in XSI conformance mode
msebor at redhat dot com
sourceware-bugzilla@sourceware.org
Tue Sep 29 21:58:00 GMT 2015
https://sourceware.org/bugzilla/show_bug.cgi?id=19029
Bug ID: 19029
Summary: _XOPEN_VERSION and _XOPEN_UNIX not defined in XSI
conformance mode
Product: glibc
Version: 2.22
Status: NEW
Severity: normal
Priority: P2
Component: libc
Assignee: unassigned at sourceware dot org
Reporter: msebor at redhat dot com
CC: drepper.fsp at gmail dot com
Target Milestone: ---
In Section 2.1.4 XSI Conformance, the latest POSIX spec states:
XSI-conforming implementations shall set the symbolic constant _XOPEN_UNIX to a
value other than -1 and shall set the symbolic constant _XOPEN_VERSION to the
value 700.
The following test shows that the latest glibc fails to define either
_XOPEN_VERSION or _XOPEN_UNIX. This problem came up while developing a
portable application that relies on _XOPEN_NAME_MAX, which is also missing
(this is the subject of bug 18229.
#define _XOPEN_SOURCE 700
#include <limits.h>
#define A(expr) _Static_assert (expr, #expr)
A (_XOPEN_UNIX != -1);
A (_XOPEN_VERSION == _XOPEN_SOURCE)
A (_XOPEN_NAME_MAX == 255);
A (_XOPEN_PATH_MAX == 1024);
tst-xopen.c:7:4: error: ‘_XOPEN_UNIX’ undeclared here (not in a function)
A (_XOPEN_UNIX != -1);
^
tst-xopen.c:5:33: note: in definition of macro ‘A’
#define A(expr) _Static_assert (expr, #expr)
^
tst-xopen.c:7:4: error: expression in static assertion is not an integer
A (_XOPEN_UNIX != -1);
^
tst-xopen.c:5:33: note: in definition of macro ‘A’
#define A(expr) _Static_assert (expr, #expr)
^
tst-xopen.c:8:4: error: ‘_XOPEN_VERSION’ undeclared here (not in a function)
A (_XOPEN_VERSION == _XOPEN_SOURCE)
^
tst-xopen.c:5:33: note: in definition of macro ‘A’
#define A(expr) _Static_assert (expr, #expr)
^
tst-xopen.c:8:4: error: expression in static assertion is not an integer
A (_XOPEN_VERSION == _XOPEN_SOURCE)
^
tst-xopen.c:5:33: note: in definition of macro ‘A’
#define A(expr) _Static_assert (expr, #expr)
^
tst-xopen.c:5:17: error: expected ‘;’ before ‘_Static_assert’
#define A(expr) _Static_assert (expr, #expr)
^
tst-xopen.c:9:1: note: in expansion of macro ‘A’
A (_XOPEN_NAME_MAX == 255);
^
tst-xopen.c:10:4: error: ‘_XOPEN_PATH_MAX’ undeclared here (not in a function)
A (_XOPEN_PATH_MAX == 1024);
^
tst-xopen.c:5:33: note: in definition of macro ‘A’
#define A(expr) _Static_assert (expr, #expr)
^
tst-xopen.c:10:4: error: expression in static assertion is not an integer
A (_XOPEN_PATH_MAX == 1024);
^
tst-xopen.c:5:33: note: in definition of macro ‘A’
#define A(expr) _Static_assert (expr, #expr)
^
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Glibc-bugs
mailing list