|
Boost : |
Subject: Re: [boost] Official warnings policy?
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2009-11-12 13:56:00
On Thu, Nov 12, 2009 at 9:58 AM, Stewart, Robert <Robert.Stewart_at_[hidden]> wrote:
> Emil Dotchevski wrote:
>> On Thu, Nov 12, 2009 at 8:48 AM, Stewart, Robert
>> <Robert.Stewart_at_[hidden]> wrote:
>> > Peter Dimov wrote:
>> >>
>> >> The test tests whether an int can be assigned to a variant,
>> >> one of whose types is a short. It should produce a warning;
>> >> in this context, this is a feature. User code that does the
>> >> same should also produce a warning. This is what warnings
>> >> are for.
>> >
>> > Shouldn't the test confirm that an int can be assigned to a
>> > short in a variant and that the resulting short has the same
>> > value as when the same int is assigned to a short not in a
>> > variant? That test need not produce a warning because
>> > comparing the results from the two assignments proves or
>> > disproves the behavior of variant.
>>
>> Do you agree that getting a warning in this use case is a good
>> thing?
>
> If the purpose of the test is to show that variant triggers the same
> warning as would an ordinary int-to-short assignment, getting the
> warning here is a good thing.
>
> If the purpose of the test is to prove that assigning to variant has
> the same runtime behavior as non-variant code, as I suggested
> above, the warning is unwarranted noise.
Lets assume it's the latter. Still, I don't think it is fair to label
the warning as unwarranted noise. It would be noise if there were 200
warnings reported from this test. Somewhere between 1 and 200,
warnings can be classified as additional information, not noise.
If a warning tells you that the code is incorrect (as in, you should
have used short instead of int for the type of a given variable) then
sure, it should be fixed. If it tells you that your correct code might
be wrong, then seeing the warning is a good thing -- unless it becomes
annoying at which point it is silenced for the sake of sanity.
In my opinion, the warning at hand is informative without being annoying.
Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk