Bug in HTOD handling <<

Andrei Khropov andkhropov at nospam_mtu-net.ru
Mon Jul 31 15:13:43 PDT 2006


BCS wrote:
 
> 
> <code name="foo.h">
> 
> #define value 3
> #define name ("BCS")
> #define mask3 (0x01<3)
> #define mask5 (0x01<5)
> #define mask35 (mask3 | mask5)
> 
> </code>
> 
>  |
>  v
> htod
>  |
>  v
> 
> <code name="foo.d">
> 
> auto value = 3;
> auto name = ("BCS");
> auto mask3 = (0x01<3);
> auto mask5 = (0x01<5);
> auto mask35 = (mask3 | mask5);
> 
> </code>

Not 'auto' but 'const' is more appropriate here:

>  |
>  v
> htod
>  |
>  v
> 
> <code name="foo.d">
> 
> const value = 3;
> const name = ("BCS");
> const mask3 = (0x01<3);
> const mask5 = (0x01<5);
> const mask35 = (mask3 | mask5);
> 
> </code>



-- 




More information about the Digitalmars-d-bugs mailing list