C++ Logo

std-discussion

Advanced search

Re: Global array of objects over multiple files

From: Lénárd Szolnoki <cpp_at_[hidden]>
Date: Sat, 19 Oct 2024 19:23:39 +0100
On 19 October 2024 18:25:03 BST, Federico Kircheis via Std-Discussion <std-discussion_at_[hidden]> wrote:
>On 19 October 2024 17:10:53 UTC, Thiago Macieira via Std-Discussion <std-discussion_at_[hidden]> wrote:
>>On Saturday 19 October 2024 09:56:11 GMT-7 Federico Kircheis via Std-
>>Discussion wrote:
>>> Dynamic kinking already breaks multiple guarantees from the standard; for
>>> example that function pointers are always valid, and many things that have
>>> to do with global objects, I personally do not see why this array should be
>>> treated differently
>>
>>None of that is true for simple C++ code. In order for any of it to happen,
>>you must have used some non-standard feature, such as an __attribute__.
>>
>
>Or dlopen, loadlibrary,... Which are just functions; outside of the standard, like the rest of dynamic linking

Those are also non-standard.

>No need for attributes, assembly, or other compiler extensions, or strange constructs.
>Global variables are problematic in shared libraries, that's it.

Problematic how?

Received on 2024-10-19 18:23:44