You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@apr.apache.org by bu...@apache.org on 2009/05/13 12:39:44 UTC

DO NOT REPLY [Bug 47191] New: Missing sentinel warning

https://issues.apache.org/bugzilla/show_bug.cgi?id=47191

           Summary: Missing sentinel warning
           Product: APR
           Version: HEAD
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: PatchAvailable
          Severity: minor
          Priority: P2
         Component: APR
        AssignedTo: bugs@apr.apache.org
        ReportedBy: rainer.jung@kippdata.de


Created an attachment (id=23650)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23650)
Adding stddef.h to header files using sentinel attribute.

In revision 683278 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=683278 ) a sentinel attribute mark was introduced to some APR
functions (trunk and 1.4).

On Solaris 8 and 10 using GCC 4 I get warnings about missing sentinels in
function calls. It turns out, that this is due to "NULL" being defined as "0"
instead of e.g. (void *)0.

This comes from the inclusion of sys/types.h, which leads to 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, because the fixincludes
version of it defines NULL as (void *)0.

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

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

to apr_strings.h etc. I think we need to add APR_HAVE_STDDEF_H to
apr.h(.in) (and configure) so we can use

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

in apr_strings.h and apr_tables.h.

I attach a patch for trunk and 1.4.x. The sentinel attribute does not exist in
other branches.

Regards,

Rainer

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 47191] Missing sentinel warning

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47191





--- Comment #1 from Joe Orton <jo...@redhat.com>  2009-05-13 06:17:31 PST ---
All supported platforms should have stddef.h, just include it unconditionally.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 47191] Missing sentinel warning

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47191





--- Comment #3 from Joe Orton <jo...@redhat.com>  2009-05-13 06:53:36 PST ---
Doing it in apr.h near the includes for sys/types.h et al seems fine to me.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 47191] Missing sentinel warning

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47191





--- Comment #4 from Rainer Jung <ra...@kippdata.de>  2009-05-14 03:22:27 PST ---
Created an attachment (id=23661)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23661)
Minimal patch, including stddef.h unconditionally in apr.h

This is the minimal patch, I guess the way as proposed by Joe.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 47191] Missing sentinel warning

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47191





--- Comment #2 from Rainer Jung <ra...@kippdata.de>  2009-05-13 06:28:12 PST ---
Do you suggest to include it directly in apr.h (like we do e.g. in apr.hw), or
like my patch does more fine-grained in those header files, that actually
declare a function with a sentinel attribute?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 47191] Missing sentinel warning

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47191





--- Comment #5 from Rainer Jung <ra...@kippdata.de>  2009-05-14 03:24:27 PST ---
Created an attachment (id=23662)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23662)
The mid-size patch: include in apr.h, but detect via configure.

This is the variant I propose, because it includes stddef.h in apr.h, so we
don't need to put it into every future header file where the attribute mark
gets used, but on the other hand it is more consistent with the rest of apr.h
(detecting the header file).

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org