tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Bogus ifdef guard in sys/null.h

Hi people,

in ,
the _SYS_NULL_H guard is bogus, since the whole header defines NULL
only. And there's already a guard for NULL. The code as it is, breaks
the following snippet:

% cat t.c
#include <stddef.h>
#undef NULL
#include <unistd.h>

    void *p = NULL;

    return 0;
% gcc t.c
t.c: In function 'main':
t.c:8: error: 'NULL' undeclared (first use in this function)
t.c:8: error: (Each undeclared identifier is reported only once
t.c:8: error: for each function it appears in.)

POSIX says that both stddef.h and unistd.h shall provide NULL. This
isn't just a thought experiment. It actually broke a test from here:

Please consider changing it, or explain why it shouldn't.

Best regards,

Home | Main Index | Thread Index | Old Index