[SAoC] 'DPP with Linux kernel headers' Project Thread

Patrick Schluter Patrick.Schluter at bbox.fr
Sat Nov 16 18:39:51 UTC 2019


On Saturday, 16 November 2019 at 14:59:51 UTC, Cristian Becerescu 
wrote:
>
> ---Bug #4---
> An enum is initialized with a value of 68719476704, which 
> produces this:
> Error: cannot implicitly convert expression 68719476704L of 
> type long to int
>
> I will probably need to check if some values of the enum are > 
> int.max, and, if so, declare "enum : long" instead of "enum".

Shouldn't that be done automatically by the D compiler? It's 
normal promotion rule, it should reflect in the base type of the 
enum. Afaict it is done that way in C (at least as an extension 
to gcc).




More information about the Digitalmars-d mailing list