Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 2 Jun 2015 13:24:11 +0200
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Subject: Re: time.h define NULL

* Tomasz Sterna <tomek@...oka.com> [2015-06-02 13:16:31 +0200]:

> Dnia 2015-06-02, wto o godzinie 11:35 +0200, Szabolcs Nagy pisze:
> > > Why does time.h unconditionally define NULL [1]?
> > because it is required
> 
> Required by what?
> 

c11 7.27.1p2

> > > /usr/include/time.h:11:9: warning: 'NULL' macro redefined
> > > [-Wmacro-redefined]
> > > #define NULL 0L
> > >         ^
> > what is the previous definition?
> > and why is that conflicting?
> 
> Previous definition is:
> #define NULL (0)
> 
> it is in one of headers of the application I'm trying to build against
> musl.
> 

that's undefined behaviour

NULL is reserved for the implementation if time.h is included.

c11 7.1.3

> Even if it is required by time.h, shouldn't it be guarded by #ifndef
> NULL? time.h is not stand-alone unit and is designed to be included to
> other software.

no

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.