[cfe-dev] Priority settings for static variables and __attribute__((destructor))
huaxia.zhao at gmail.com
Sun Feb 17 03:37:58 PST 2013
I am helping to debug a Mach-o dylib program written by C++ and there are
some codes like this:
class Resource ; // global static variable
When dylib unloaded, the static variable Resource will be unloaded
first then clang will call shutdown() with a crash. I tried GCC style
__attribute__((destructor(100))) to set the priority but it seems that
clang cannot recongnised this.
Is there anyway I can precisely constrol the order of static variables
deconstruction and attributed destructor functions in clang. My
environment is Mac OS X 10.7.5, Xcode 4.6 with clang-425.0.24
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev