Boost logo

Boost :

Subject: Re: [boost] "peer reviewed" - Rights and responsibilities of maintainers
From: Robert Ramey (ramey_at_[hidden])
Date: 2018-10-17 16:25:34


On 10/17/18 8:52 AM, Peter Dimov via Boost wrote:
> Robert Ramey wrote:
>> When I looked at the test my attention was immediately drawn to the
>> following:
>>
>> const char* impossible = "impossible";
>> return impossible !=
>> boost::serialization::extended_type_info_typeid<float>::get_const_instance().get_key();
>>
>>
>> I memory serves me, get_key() will return the address of string of
>> characters inside the the address space of the DLL.  This address is
>> compared to the address of "impossible" which is an address inside the
>> address space of the calling mainline application.  I could not and
>> cannot understand what is being tested here.
>
> It's a dummy comparison whose only purpose is to make use of the return
> value to prevent the optimizer from removing the call entirely.

Hmmm - but the value of the comparison is used in the determination of
the test results. Very unintuitive. Why not compare to nullptr (or 0
or whatever) which is what get_key() expected to return since no entries
have been added to the extended type info table.

There is also an interesting issue of using float and int as type
arguments. This is never been done before since no user of the
serialization library would do this. It's an interesting new variable
in the mix and offhand I don't really know if there are any consequences
to this.

Robert Ramey

>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk