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

Jonathan M Davis newsgroup.d at jmdavisprog.com
Tue Sep 1 01:48:42 UTC 2020


On Wednesday, August 26, 2020 10:28:13 PM MDT Walter Bright via Digitalmars-d 
wrote:
> On 8/25/2020 2:28 AM, ParticlePeter wrote:
> > The code I am talking about is unchanged since at least, dmd 2.086,
> > now I am getting the Deprecation message.
>
> That's because printf format checking is a new feature. Your code was
> actually broken before, although it appeared to work. It would likely have
> failed more obviously if there were more argments after ul, or if your
> machine was bigendian.
>
> This change uncovered a lot of similar latent bugs in programs.

It's the kind of breaking change that's actually nice, since it's finding
bugs for you (like when fallthrough on switch statements was banned outside
of empty case statements).

- Jonathan M Davis





More information about the Digitalmars-d mailing list