Type-safer usage of diagnostics outputting in dmd

Per Nordlöw per.nordlow at gmail.com
Tue Sep 1 22:14:11 UTC 2020


The diagnostics functions in `dmd.errors` are now qualified [1] 
with the, by Walter, recently added

     pragma(printf)

when the compiler supports it (from dmd version 2.092 and 
upwards).

In other words, a mismatch between the format part and the 
argument part in a call to either of

- error(const ref Loc loc, const(char)* format, ...)
- warning(const ref Loc loc, const(char)* format, ...)
- message(const ref Loc loc, const(char)* format, ...)
- deprecation(const ref Loc loc, const(char)* format, ...)
- ...

will now issue a warning.

[1] https://github.com/dlang/dmd/pull/11638


More information about the Digitalmars-d-announce mailing list