I can crash program (core.exception.InvalidMemoryOperationError) by using __FUNCTION__ in a class ctor

Steven Schveighoffer schveiguy at gmail.com
Fri Jan 18 18:47:15 UTC 2019


On 1/18/19 1:37 PM, Jonathan M Davis wrote:
> On Friday, January 18, 2019 10:17:02 AM MST Steven Schveighoffer via
> Digitalmars-d wrote:
>> On 1/18/19 12:08 PM, Adam D. Ruppe wrote:
>>> On Friday, 18 January 2019 at 17:03:59 UTC, Steven Schveighoffer wrote:
>>>> import std.internal.cstring;
>>>
>>> The only downside here is the internal namespace has no public
>>> guarantees; the phobos devs can remove or modify it as they want without
>>> notice.
>>
>> I'm 99.9% sure the behavior of tempCString won't be changed or removed
>> in a way that breaks code.
> 
> The safest thing for anyone wanting to use std.internal.cstring is to just
> copy the module into their own project, though arguably, it's one of those
> things that should be cleaned up and made public instead of being in
> internal (which would actually break any code currently using
> std.internal.cstring). Regardless, I would definitely _not_ advise anyone to
> just import something from internal, and I definitely don't want to see
> anyone trying to argue later that we can't change something from internal
> just because a bunch of people decided that something from there was useful
> and started importing it. While the risk of your code breaking later on
> because it's using something from internal _might_ be low, it is basically
> begging for it to be broken at some point.

I'm not speaking about rules or restrictions, I'm talking about 
stability. tempCString is pretty stable and likely won't change in any 
way except implementation details.

-Steve


More information about the Digitalmars-d mailing list