C++ Logo

std-proposals

Advanced search

Re: [std-proposals] set_new_handler extension

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Sat, 11 Feb 2023 21:31:09 -0500
On Sat, Feb 11, 2023 at 6:45 PM Phil Bouchard via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> They already do partially with the "static" keywords and all the attributes.

Um, where? Where is there wording in the standard about the
interactions between `static` and shared objects/dynamic libraries? Or
C++-defined standard attributes that interact with them?

The call to the memory allocation function is a static one; as such,
overriding new/delete globally requires that all such code includes
that override. Just like if you don't include a particular function
overload, you can't call it.

> But I seriously think the standards should consider linker issues
> because right now nothing prevents Microsoft from blacklisting and
> making crash competitor's products.

That's some pretty deep paranoia. It's also highly misplaced.

If Microsoft wanted to want to "blacklisting and making crash
competitor's products", they have 100% of the tools that they need to
do that right now. They don't have to sneak in something into the
memory allocator; if Windows detects that your program is one it wants
to shut down, the OS can just yank the process. And there's nothing
you or the C++ committee can do to stop them.

It's their operating system. That's what you signed up for when you
wrote software for it. If you're concerned about anti-competitive
behavior out of them, you need a political solution, not a
technological one.

> If you have an application that is ISO certified then it you should also
> guarantee the low level allocation routines will never crash as well.

And you can. I presume that ISO certification would include looking at
all of the shared libraries being used by the application, yes?

Received on 2023-02-12 02:31:49