[Development] PSA: symbol visibility and export macros need to be re-thought for clang/libc++
Giuseppe D'Angelo
giuseppe.dangelo at kdab.com
Fri Apr 4 19:31:48 CEST 2025
On 04/04/2025 17:44, Thiago Macieira wrote:
>
> The conclusion from this is that, from the point of view of the C++ language,
> they*are* different types, even if they have the same mangling and can (and
> are) passed across library boundaries in by value, by pointer, in containers,
> etc. The big problem here is that the C++ standard does not recognise shared
> libraries & DLLs exist, so this is an area that is underdeveloped. Despite
> being the mainstream.
>
> IMNSHO, this needs to be addressed in the Standard, ahead of modules even.
I wouldn't hold my breath there. If we think that Clang's
type_visibility attribute helps, we should instead ask GCC to implement
the same, and start plastering our public APIs with it. At least this
will give us some useful results in 2-3 years time, rather than 10-20.
(I'm still unsure about _how_ the attribute works, specifically how does
it figure out the TU and thus the shared library in which to pin the
RTTI information?)
My 2 c,
--
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - Trusted Software Excellence
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4244 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.qt-project.org/pipermail/development/attachments/20250404/f388ccc9/attachment.bin>
More information about the Development
mailing list