Bug 35082 - Incorrect definition of BOOL
Summary: Incorrect definition of BOOL
Status: RESOLVED INVALID
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_ssl (show other bugs)
Version: 2.0.54
Hardware: All All
: P1 trivial (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-26 09:23 UTC by Marc Stern
Modified: 2005-12-08 10:31 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Stern 2005-05-26 09:23:39 UTC
In mod_ssl.h, BOOL is defined as "unsigned int".
Some mod_ssl parameters are defined as BOOL:
    struct SSLSrvConfigRec {
        SSLModConfigRec *mc;
        BOOL             enabled;
        BOOL             proxy_enabled;
        const char      *vhost_id;
        int              vhost_id_len;
        int              session_cache_timeout;
        modssl_ctx_t    *server;
        modssl_ctx_t    *proxy;
    };
In ssl_config.c, the parameters are initialized with UNSET:
    sc->enabled                = UNSET;
    sc->proxy_enabled          = UNSET;

UNSET is defined as -1 ==> signed/unsigned problem
 
Shouldn't we change the BOOL definition to signed int ?
 
Rem: On some compilers, BOOL may be already defined, so the run-time libraries
definition is used instead of mod_ssl one, but not with, for example, VC++
Comment 1 Joe Orton 2005-06-01 11:47:01 UTC
Is there a practical problem here?  -1 is converetd to an unsigned int by the
compiler, that has well-defined behaviour in C.  Patches to remove BOOL from
mod_ssl on the trunk are welcome to dev@httpd.
Comment 2 Marc Stern 2005-06-01 13:47:51 UTC
OK, looks safe.
Sorry, I was only perturbated by the warnings
Comment 3 Joshua Slive 2005-12-08 19:31:38 UTC
Not a bug.