[Issue 10522] __FILE__ and other special keywords cannot be used with printf

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 19 08:35:41 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10522



--- Comment #2 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-08-19 08:35:40 PDT ---
(In reply to comment #1)
> Neither can string literals!  printf is a c-varargs function, and has no way of
> knowing you want the implicit conversion to const(char)*.

I guess that shows how spoiled I am by D's variadic templates. :)

> printf("-- %s\n", cast(const(char*))__FILE__);

Also __FILE__.ptr and __FILE__.toStringz.

-- 
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