dmd 178 changes (177 not 178) and more

Lionello Lunesu lio at lunesu.remove.com
Mon Dec 11 06:59:26 PST 2006


Ant wrote:
> and more, this is invalid:
> 
> printf("Couldn't compile sources for "~name.toString()~"\n");
> 
> function object.printf (char*,...) does not match parameter types (char[])
> 
> but this is valid:
> 
> printf("Couldn't compile sources for ");//~name.toString()~"\n");
> 
> ???
> 
> Ant

Well, I think it actually IS invalid. The string in your first example 
is not zero terminated! A string literal guaranteed to be zero 
terminated, but a char[] is not. This is a perfect example why [] -> * 
conversion was removed.

L.


More information about the Digitalmars-d-learn mailing list