Deprecation: argument `ul` for format specification `"%lu"` must be `int`, not `ulong`

ParticlePeter ParticlePeter at gmx.de
Tue Aug 25 09:28:00 UTC 2020


On Tuesday, 25 August 2020 at 09:06:27 UTC, Mathias LANG wrote:
> On Tuesday, 25 August 2020 at 08:14:23 UTC, ParticlePeter wrote:
>> void main()  {
>>     import core.stdc.stdio : printf;
>>     ulong ul = 0;
>>     printf( "%lu\n", ul );
>> }
>>
>> Tested on dmd 2.093 and 2.093.1 (noticed on later first time), 
>> with flag -m64.
>> Same message when format specifier is %u.
>>
>> Is this intended behavior?
>
> Yes. You should use `llu`. 
> https://en.wikipedia.org/wiki/C_data_types

Thanks, I oversaw that a ulong means unsigned long long.

> Also those questions are better suited for the `D.learn` forum.

What makes you think I am learning (printf), and what do you mean 
by 'those questions' ? The code I am talking about is unchanged 
since at least, dmd 2.086, now I am getting the Deprecation 
message.


More information about the Digitalmars-d mailing list