[Interest] [Qt-interest] Calling qRegisterMetaType on static initialization

Thiago Macieira thiago at kde.org
Wed Jan 25 21:41:38 CET 2012


On Tuesday, 24 de January de 2012 22.21.42, Till Oliver Knoll wrote:
> p.s. Btw the last time I asked a question in the c++ comp group (really
> years ago) related to "shared libs" I was told: "That's not part of the C++
> standard, dude - go read the man pages of your compiler/linker!"

The C++ standard does define what static initalisation and dynamic 
initialisation are, what runs at what order, what isn't ordered and even how 
to undo (destruct).

What it doesn't deal with and is sometimes important is the case of plugin 
loading. The plugin's static variables also suffer static and dynamic 
initialisation, but the program is already running at this point and there are 
even possibly multiple threads.

That, of course, assumes that the compiler, linker and runtime do implement 
the standard correctly, which isn't always a valid assumption.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120125/6e6cd2fb/attachment.sig>


More information about the Interest mailing list