Integer promotion... what I'm missing? (It's monday...)
Derek Parnell
derek at nomail.afraid.org
Mon Jun 19 18:06:14 PDT 2006
On Tue, 20 Jun 2006 04:06:37 +0200, Paolo Invernizzi wrote:
> Deewiant wrote:
>> Tony wrote:
>>> I would prefer that any type promotions (and any implicit operations for
>>> that matter) should guarantee not to introduce any data corruption. In this
>>> case, promote both numbers to a third type which can hold all possible
>>> values from both.
>>>
>> I think a warning for all such cases would suffice --- I thought one would be
>> emitted for the original code, but evidently not.
>
> Instead of a warning, I would prefer an error, forcing for an explicit
> cast if the comparison it's what you really want to to. But only for
> rule number 4.
>
Just to note that with DMD, a 'warning' is really an optional error. In
other words, if you have -w switch and it displays a 'warning', the
compiler still fails to create the object file because it treats such
warnings as if they were errors.
--
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Down with mediocrity!"
20/06/2006 11:04:06 AM
More information about the Digitalmars-d-learn
mailing list