
Dear Wolfgang,
On 11/05/2010 01:23 PM, Wolfgang Denk wrote:
Dear Sebastien Carlier,
In message4CD3F58F.8090302@gmail.com you wrote:
It does seem like weak symbols were designed with other uses in mind, such as C++ class members defined within a class declaration, or to weak the dependencies between libraries... but not really to allow overridable definitions (what if two objects want to override the same weak symbol in different ways?).
Well, but that's exactly why they are used in library code: to allow overridable definitions.
If this usage were specifically designed for, do you think the linker would silently allow multiple yet conflicting weak definitions for the same symbol? It is true that weak symbols can be used to support overridable definitions, but they seem more suitable for other uses.
Regards,
Sebastien Carlier