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 libc/21371] Missing timespec definition when compiled with _XOPEN_SOURCE and _POSIX_C_SOURCE


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]