[Issue 4458] Static typing for format strings, when possible
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Feb 28 04:43:07 PST 2011
http://d.puremagic.com/issues/show_bug.cgi?id=4458
--- Comment #2 from bearophile_hugs at eml.cc 2011-02-28 04:40:16 PST ---
Among the SAL (Microsoft's standard source code annotation language) there is
__format_string too, it denotes strings that contains % markers in the style of
printf:
http://msdn.microsoft.com/en-us/library/ms235402%28VS.80%29.aspx
In D it may be useful to catch bugs like this:
@format_string string f = "%d";
writeln(f, 10);
n most cases you don't want to print a format string. The compiler may show a
warning, saying that you are using a format string as first argument of a
printing function that doesn't use a format string. This warning helps against
that bug.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list