httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rüdiger Plüm <r.pl...@gmx.de>
Subject Re: svn commit: r312964 - in /httpd/httpd/branches/2.2.x: CHANGES modules/proxy/mod_proxy_balancer.c modules/proxy/proxy_util.c
Date Wed, 12 Oct 2005 20:58:37 GMT


On 10/12/2005 01:38 PM, Joe Orton wrote:

[..cut..]

> 
> 
> Yup, if using strchr on a const variable, the correct method to preserve 
> const-ness and avoid those warnings is:
> 
>   const char *foo;
> 
>   foo = ap_strchr_c(some_const_char_string, 'x');
> 
> note that 'c' would need to be const above too.

Thanks for that info. It took me a while to understand the macros
in util_debug.c / httpd.h (small letter macros OtherBill
just mentioned to dislike :-)).

I think I understand now what is going on and that in DEBUG mode
the strict checking whether const or not is enforced by wrapper
functions whereas in the non debug mode it is a simple macro that
maps things directly to the libc functions which do not do this strict
checking sometimes.
If I understand Jim correctly we should use ap_strchr / ap_strchr_c
throughout the code, but it is not done currently. Maybe I have a look
into this on a rainy day and exchange strchr against ap_strchr / ap_strchr_c
where appropriate :-).


Regards

Rüdiger




Mime
View raw message