|
Boost : |
Subject: Re: [boost] [Boost.Asio] Compiler warning in address_v6.hpp
From: Sohail Somani (sohail_at_[hidden])
Date: 2009-04-01 22:33:30
Steven Watanabe wrote:
> AMDG
>
> Fraser Hutchison wrote:
>> I'm new to boost and am looking for a bit of advice if possible.
>>
>> asio/ip/address_v6.hpp lines 58 & 355 yield the following compiler
>> warnings when flag -Wmissing-braces (which is enabled by -Wall) is set:
>>
>> missing braces around initializer for 'u_char [16]'
>> missing braces around initializer for 'in6_addr::<anonymous union>'
>>
>> These can be avoided by amending e.g. line 58 from
>>
>> boost::asio::detail::in6_addr_type tmp_addr = IN6ADDR_ANY_INIT;
>>
>> to
>>
>> boost::asio::detail::in6_addr_type tmp_addr = {{IN6ADDR_ANY_INIT}};
>>
>> Is this worth submitting a bug report and patch for this, or not?
>
> Asio is using IN6ADDR_ANY_INIT correctly. Such a "fix" will
> break on any platform for which IN6ADDR_ANY_INIT is defined
> sanely.
I had a similar problem on AIX. I patched ASIO to do roughly:
#ifdef AIX (whatever the macro is)
# define IN6ADDR_ANY_INIT {{WHATEVER}}
#else
# define AS_BEFORE
#endif
-- Sohail Somani http://uint32t.blogspot.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk