[Issue 11837] String literals should convert to const(void)*

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 9 04:37:26 PDT 2014


https://d.puremagic.com/issues/show_bug.cgi?id=11837


Iain Buclaw <ibuclaw at ubuntu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw at ubuntu.com


--- Comment #16 from Iain Buclaw <ibuclaw at ubuntu.com> 2014-03-09 04:37:16 PDT ---
The way I see it, relying on implicit conversion should be avoided where
possible. And where implicit conversion is allowed, enforce that only one path
could be taken. In this example, that means string -> const(char*), or string
-> const(void*), but not both.

Assuming this is for DDMD, then I'd suggest either grin and bear it, this kind
of code will be cleaned up.  Or use strcmp, which IIRC takes a const(char*) as
its parameters - and if the operation is comparing a (void*) with a (char*),
then explicitly cast the (void*) up.

As for Walter and Andrei's reasoning.  I am not opined in that way, but I would
suggest that you prove that this change doesn't break eg:

int foo(in void*);
int foo(in char*);

And if it does break overloading, provide good reasoning why this should be
invalid.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list