{"id":12161,"date":"2021-05-12T08:14:50","date_gmt":"2021-05-12T08:14:50","guid":{"rendered":"http:\/\/blog.bachi.net\/?p=12161"},"modified":"2021-05-12T08:26:30","modified_gmt":"2021-05-12T08:26:30","slug":"gcc-clang-__attribute__","status":"publish","type":"post","link":"https:\/\/blog.bachi.net\/?p=12161","title":{"rendered":"GCC\/clang __attribute__"},"content":{"rendered":"<h3>__attribute__((constructor[(priority)]))<\/h3>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/2053029\/how-exactly-does-attribute-constructor-work\">How exactly does __attribute__((constructor)) work?<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/50695530\/gcc-attribute-constructor-is-called-before-object-constructor\">GCC __attribute__((constructor)) is called before object constructor<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/8433484\/c-static-initialization-vs-attribute-constructor\">C++ static initialization vs __attribute__((constructor))<\/a><br \/>\n<a href=\"https:\/\/developer.arm.com\/documentation\/dui0491\/g\/Compiler-specific-Features\/--attribute----constructor--priority-----function-attribute\">__attribute__((constructor[(priority)])) function attribute<\/a><br \/>\n<a href=\"https:\/\/www.keil.com\/support\/man\/docs\/armclang_ref\/armclang_ref_chr1383738546439.htm\">__attribute__((constructor(priority))) function attribute<\/a><\/p>\n<h3>__attribute__((init_priority(X)))<\/h3>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/3371968\/attribute-init-priorityx-in-gcc\">__attribute__((init_priority(X))) in GCC<\/a><\/p>\n<h3>__attribute__((weak))<\/h3>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/51656838\/attribute-weak-and-static-libraries\">__attribute__((weak)) and static libraries<\/a><\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\nvoid noOsSystickHandler() { } \/\/ empty \r\nvoid osSystickHandler() __attribute__((weak, alias(&quot;noOsSystickHandler&quot;)));\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>__attribute__((constructor[(priority)])) How exactly does __attribute__((constructor)) work? GCC __attribute__((constructor)) is called before object constructor C++ static initialization vs __attribute__((constructor)) __attribute__((constructor[(priority)])) function attribute __attribute__((constructor(priority))) function attribute __attribute__((init_priority(X))) __attribute__((init_priority(X))) in GCC __attribute__((weak)) __attribute__((weak)) and static libraries void noOsSystickHandler() { } \/\/ empty void osSystickHandler() __attribute__((weak, alias(&quot;noOsSystickHandler&quot;)));<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-12161","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/12161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12161"}],"version-history":[{"count":4,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/12161\/revisions"}],"predecessor-version":[{"id":12165,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/12161\/revisions\/12165"}],"wp:attachment":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}