C++ Logo

std-proposals

Advanced search

Re: Memory safety guarantees

From: Thomas Neumann <tneumann_at_[hidden]>
Date: Thu, 22 Apr 2021 22:35:25 +0200
Hi,

> 1) An implementation before the proposal would be an absolute necessity.
> Nothing stops you from doing it, today, in 100% legal C++, given you an
> always define your implementation-specific attributes with your custom
> semantics.

sure, I am fully aware of that. And actually I would prefer doing a
"real" implementation in clang, at least as a prototype, as I would like
to see if this really works for meaningful, complex code. (And if the
compiler simply ignores my attributes I cannot test if the borrow
mechanism does what I expect it to do).

> 2) Are you familiar with the lifetime proposal? How is yours interacting
> with it? https://wg21.link/p1179

I know that proposal, and I have played with the experimental -Wlifetime
branch, but I am not fully convinced that P1179 is the right direction.
Just like my proposal it requires code style changes, we cannot take
arbitrary existing code and expect it to work. But the benefit is
weaker, while it can detect some common cases of memory safety problems
it cannot guarantee memory safety in a strict sense. And if I have to
change my code anyway I would rather prefer to change to a model the
really guarantees safety.
(So to summarize your question: My proposal is competing with P1179 and
is not really compatible).

Best

Thomas

Received on 2021-04-22 15:35:28