Documentation re -betterC compatibility with standard library functions

Jonathan M Davis newsgroup.d at jmdavisprog.com
Tue Jan 28 15:23:50 UTC 2025


On Tuesday, January 28, 2025 8:04:36 AM MST Dennis via Digitalmars-d-learn wrote:
> On Tuesday, 28 January 2025 at 15:00:13 UTC, Jonathan M Davis
> wrote:
> > but we provide no guarantees that any code that works with
> > -betterC right now will continue to do so, and we do not intend
> > to add -betterC support. So, if you use something from Phobos
> > that happens to work with -betterC today, it could stop working
> > with -betterC tomorrow if a change is made to fix or improve
> > something, and it's not compatible with -betterC.
>
> There are @betterC unittests in Phobos. Those could be modified,
> but I'd say those unittests give soft guarantees of whatever
> functions they're testing working with -betterC.

There are some, but there aren't many, and the're there because an
individual developer decided to go in there and add them. When -betterC came
up in DLF meeting a few months ago, it was decided that we definitely
weren't supporting it with the standard library and that folks were on their
own when using it (outside of compiler support, of course). It's also the
current plan that Phobos v3 will not be supporting -betterC.

So, yes, those few items in Phobos that currently have @betterC unit tests
are being tested that they work with -betterC, but at best, it's a soft
guarantee, because if there's ever a reason why we need to do something that
would not be compatible with -betterC, then the requirement will likely be
removed from the unittest block rather than not improving the code.

- Jonathan M Davis





More information about the Digitalmars-d-learn mailing list