BIND 10 #168: separate ASIO from Boost and remove custom code
BIND 10 Development
do-not-reply at isc.org
Thu May 27 00:35:15 UTC 2010
#168: separate ASIO from Boost and remove custom code
--------------------------+-------------------------------------------------
Reporter: larissas | Owner: each
Type: task | Status: reviewing
Priority: major | Milestone: 04. 2nd Incremental Release
Component: Unclassified | Resolution:
Keywords: | Sensitive: 0
--------------------------+-------------------------------------------------
Comment(by jinmei):
Replying to [comment:11 jinmei]:
> hmm, the ASIO branch doesn't even compile without --with-boost-includes:
Okay, I figured it out. That's because there are some functions that hit
the "unused-parameter" warning in header files of the non boost version of
ASIO. I suspect we were free from this in the boost version because we
used a separate object library where the source code that would hit the
warning is hidden.
The whole purpose of the migration to the non boost ASIO is to avoid
dependency on external object libraries, so we need to deal with it
anyway.
I found a workaround in the epoll version of the refactor file:
{{{
void cancel_ops(socket_type descriptor UNUSED_PARAM,
per_descriptor_data& descriptor_data)
{
}}}
that is, {{{UNUSED_PARAM}}} is specified. I guess Evan explicitly added
this to the original source code. Doing this every time we hit this
problem is one option, but I don't think it a good idea; however, I don't
like to compromise the warning level due to a problem of an external
source either.
I've not come up with a satisfactory solution, but I'm attaching a patch
that I think is least evil: it introduces a small wrapper module
(asio_link) as a separate internal "library" (only used for b10-auth), and
exclude unused-parameter from the erroneous warnings only for that
library.
This is a bit tricky and ugly, but this way we can limit the compromise to
the code directly related to ASIO. Also, whether or not we have this
problem, or whether or not we solve this as a separate library, I think we
should eventually separating this part from main.cc anyway, for making
tests easier and making the code more modular.
Also note that the use of pimpl is crucial in this case. We cannot
include asio.h in asio_link.h, because other part of b10-auth needs to
include asio_link.h, and it would subsequently include asio.h and we'd
encouter the same problem. (admittedly this can be solved without pimpl.
but the main point is that it's generally preferable to avoid including
external header files directly from our own header files)
--
Ticket URL: <https://bind10.isc.org/ticket/168#comment:12>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list