Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 24 Nov 2011 00:12:23 +0100 (CET)
From: Pavel Kankovsky <>
Subject: Re: glibc' time.h dependency on stdlib.h (was: glibc

On Mon, 21 Nov 2011, Vasiliy Kulikov wrote:

> build@...atros:~ $ gcc -D_GNU_SOURCE -Wall a.c -o a
> In file included from a.c:1:0:
> /usr/include/time.h:226:5: error: unknown type name '__locale_t'
> A bug in glibc headers dependency?  Or time.h really must be included
> only after explicit stdlib.h, which was not forced by our old glibc?

It is a bug.

strftime_l and strftime_l used to be GNU extensions but the latter
function was adopted by POSIX 2008. #ifdef __USE_GNU was split into
#ifdef __USE_XOPEN2K8 followed by #ifdef __USE_GNU but there is only one 
#include <xlocale.h> in the first conditional section. See


It appears __USE_GNU is defined when your test case is compiled but
__USE_XOPEN2K8 is not defined. This should never happen. _GNU_SOURCE is
supposed to all POSIX features including __USE_XOPEN2K8 (indirectly by
#define _POSIX_C_SOURCE 200809L).

Pavel Kankovsky aka Peak                          / Jeremiah 9:21        \
"For death is come up into our MS Windows(tm)..." \ 21st century edition /

Powered by blists - more mailing lists

Your e-mail address:

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.