In revision 683278 Joe introduced a sentinel attribute mark to some APR
functions (trunk and 1.4).

When compiling httpd trunk I noticed, that on Solaris 8 and 10 using GCC
4 I get warnings about missing sentinels in function calls. I also get
it on some apr files, like e.g. apr_tables.c.

It turns out, that this is due to "NULL" being defined as "0" instead of
e.g. (void *)0.

I can see, that this comes from the inclusion of sys/types.h, which
leads to /usr/include/iso/time_iso.h being included. That file defines
NULL as 0.

sys/types.h occurs very early in the list of includes in apr.h

For gcc 4.1.2 I can add stddef.h, but only because the fixincludes
version of it defines NULL as (void *)0. For gcc 3.4.3 this does not
work (but there is no warning to fix either).

Now apr does set HAVE_STDDEF_H only in apr_private.h, so I can't simply
add something like

#ifdef HAVE_STDDEF_H
#include <stddef.h> /* NULL */
#endif

to apr_strings.h. I think we need to add a new APR_HAVE_STDDEF_H to
apr.h(.in) and then we can add

#if APR_HAVE_STDDEF_H
#include <stddef.h> /* NULL */
#endif

to apr_strings.h, apr_tables.h etc.

Should I prepare a patch along those lines?

Regards,

Rainer

Reply via email to