> Author: cmpilato > URL: http://svn.apache.org/viewvc?rev=1398983&view=rev > Log: > Reintegrate into trunk the 'http-dynamic-prop-namespaces' branch > (using a simple 'svn merge BRANCH-URL' with a trunk@HEAD client!).
> Modified: subversion/trunk/subversion/mod_dav_svn/deadprops.c > +static dav_prop_name * > +propname_to_davname(const char *propname, [...] > +{ [...] > + colon = strrchr((char *)propname, ':'); deadprops.c:134:26: cast discards '__attribute__((const))' qualifier from pointer target type Why cast away 'const'? Standard strrchr() accepts const. Ugh... What's happening is 'httpd.h' is messing with the standard lib functions: In /usr/include/apache2/httpd.h: [[[ /* The C library has functions that allow const to be silently dropped ... these macros detect the drop in maintainer mode, but use the native methods for normal builds [...] */ AP_DECLARE(char *) ap_strrchr(char *s, int c); AP_DECLARE(const char *) ap_strrchr_c(const char *s, int c); #ifdef AP_DEBUG # undef strrchr # define strrchr(s, c) ap_strrchr(s,c) #else # define ap_strrchr(s, c) strrchr(s, c) # define ap_strrchr_c(s, c) strrchr(s, c) #endif ]]] I'm doing an AP_DEBUG build. If I remove the explicit cast, I see a different warning: deadprops.c:134:7: warning: passing argument 1 of 'ap_strrchr' discards 'const' qualifier from pointer target type So neither way works cleanly for me. But that's an artifact of a badly designed HTTPD header -- it has no business forcing third-party users of HTTPD code to follow their chosen rules for stdlib functions. We shouldn't have the explicit cast. - Julian