www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17868] New: add pragma(crt_con/destructor[, priority])


          Issue ID: 17868
           Summary: add pragma(crt_con/destructor[, priority])
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: code dawg.eu

To allow people some low-level integration with CRT construction/destruction.
An optional priority between 101 and 65535 is supported by GCC/clang (using
sorted .init_array.* sections, e.g. .init_array.101).
We should match that C/C++ implementation.


There is also init_priority for C++ static initializers. It relies on the same
priority mechanism.


The priority sorting is only implemented when using the GNU/Linux linker, we
need to check whether we can implement it for other platforms.

Oct 01 2017