When compiling Subversion, GCC now gives this warning whenever
apr_network_io.h is included:
/usr/local/apache2/include/apr_network_io.h:718: warning: \
declaration of `socket' shadows global declaration
The warnings result from these macros:
APR_DECLARE_INHERIT_SET(socket);
APR_DECLARE_INHERIT_UNSET(socket);
...which *look* like they're taking a parameter named `socket' and
(GCC presumes) using it as a variable within the macro expansion. Of
course, we all know that's not what's happening -- instead, the macro
expands to a declaration that has "socket" as a substring in its name.
So it would be fair to call this a compiler bug, in that GCC is giving
overeager warnings.
Unfortunately, fixing this in GCC might be a lot of work; possibly a
*real lot*, depending on the amount of automated analysis required and
when/where it needs to happen.
Maybe we could just change APR? I don't have a specific solution to
propose, as I haven't really looked at what-all the inherit_set/unset
stuff is doing; maybe someone who knows better could say what our
options are?
The warnings are a big problem; they cause us to miss real warnings
from our code, because we're getting used to skipping over these bogus
warnings.
-K