Why is char initialized to 0xFF ?

Patrick Schluter Patrick.Schluter at bbox.fr
Sun Jun 9 18:27:07 UTC 2019


On Sunday, 9 June 2019 at 12:19:43 UTC, Ola Fosheim Grøstad wrote:
> On Sunday, 9 June 2019 at 08:36:30 UTC, Patrick Schluter wrote:
>> No, by putting NaN in d you hav e a deterministic error. In C 
>> and C++ you will have undefined behaviour that will vary with 
>> compiler, version, options, OS version, architecture, position 
>> of the moon, etc. and sometimes undetectable bugs.
>
> I don't think it is undefined though…

It is undefined behaviour by the definition of the standard. 
undefined behaviour includes behaviour that can be explained.




More information about the Digitalmars-d mailing list