Yet another slap on the hand by implicit bool to int conversions
Mehrdad
wfunction at hotmail.com
Sun Jun 19 17:18:54 PDT 2011
On 6/19/2011 2:24 PM, Vladimir Panteleev wrote:
> On Sun, 19 Jun 2011 23:13:06 +0300, Andrej Mitrovic
> <andrej.mitrovich at gmail.com> wrote:
>
>> So I've had a pretty fun bug today when porting some code over to D.
>> When I port C code to D, first I do a one-to-one translation and make
>> sure everything works before I try to make use of any D features.
>
> How would you expect D to deal with types such as BOOL (which is a
> 32-bit type)?
>
I agree, this is a ridiculous bug to have to spend so much time for.
How do you deal with BOOL? By emitting a **Warning** instead of an
error, which is only turned on with an appropriate compiler option (say,
higher verbosity).
Simple as that. :)
Mehrdad
More information about the Digitalmars-d
mailing list