httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe Jr." <>
Subject Re: logging patch bug
Date Wed, 01 Dec 2010 03:15:48 GMT
On 10/13/2010 4:46 PM, Philip Prindeville wrote:
>  On 10/12/10 12:57 PM, Stefan Fritsch wrote:
>> On Monday 11 October 2010, William A. Rowe Jr. wrote:
>>> Why were ap_errorlog_format_item->min_loglevel and
>>> ap_errorlog_info->level declared with two different types?
>> ap_errorlog_info->level is -1 if no log level is available, i.e. when
>> logging per-request/per-conn info. However, ap_errorlog_format_item-
>>> min_loglevel always contains a genuine loglevel (which is>=0).
>> Therefore I have declared the former as signed int and the latter as
>> unsigned int.
>> But the comparison (item->min_loglevel>  info->level) in log.c does
>> cause a warning with -Wextra, even if it is correct. What do you
>> suggest? Adding a cast or changing the declaration of min_loglevel to
>> signed int?
> If they are only compared in one place, I'd use a cast.  Least churn, and it means that
> static analysis could still be used elsewhere to easily detect when out-of-range
> assignments are made to the latter.

In any case, this should be fixed before the tag, since it's been almost 2 mos here...

.\server\log.c(1020) : warning C4018: '>' : signed/unsigned mismatch

View raw message