This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/21371] Missing timespec definition when compiled with _XOPEN_SOURCE and _POSIX_C_SOURCE
- From: "arjun.is at lostca dot se" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 20 Apr 2017 12:15:18 +0000
- Subject: [Bug libc/21371] Missing timespec definition when compiled with _XOPEN_SOURCE and _POSIX_C_SOURCE
- Auto-submitted: auto-generated
- References: <bug-21371-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=21371
Arjun Shankar <arjun.is at lostca dot se> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |arjun.is at lostca dot se
--- Comment #1 from Arjun Shankar <arjun.is at lostca dot se> ---
This smaller example reproduces it for me:
#define _XOPEN_SOURCE 700
#define _POSIX_C_SOURCE 200112L
#include <sys/stat.h>
However, even smaller examples:
#define _XOPEN_SOURCE 700
#include <sys/stat.h>
OR
#define _POSIX_C_SOURCE 200112L
#include <sys/stat.h>
OR
#include <sys/stat.h>
- work fine.
I see that line ~36 of sys/stat.h includes time.h (which may or may not define
'struct timespec' based on enabled features). Later on, bits/stat.h defines
'struct stat' using 'struct timespec' __USE_XOPEN2K8 is defined, and without
using it if it isn't. The mismatch between the conditions that lead to 'struct
timespec' being defined, and the conditions that lead to it being used in the
definition of 'struct stat' - is what causes this error.
--
You are receiving this mail because:
You are on the CC list for the bug.