[Issue 19002] __FUNCTION__ and __PRETTY_FUNCTION__ are not C string literals

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 27 07:20:21 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=19002

Seb <greensunny12 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |greensunny12 at gmail.com

--- Comment #1 from Seb <greensunny12 at gmail.com> ---
This is expected as all string literals should be zero-terminated D strings.
So the following works as expected:

```
void main()
{
   import core.stdc.stdio;
   printf(__FUNCTION__.ptr); 
}
```

The interesting bit is why __FILE__ and __MODULE__ can be passed directly to
printf.

--


More information about the Digitalmars-d-bugs mailing list