https://bugs.llvm.org/show_bug.cgi?id=38326
Bug ID: 38326
Summary: init_priority(65535) behavior differs from g++
Product: clang
Version: 5.0
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangb...@nondot.org
Reporter: stephane.zimmerm...@trust-in-soft.com
CC: dgre...@apple.com, llvm-bugs@lists.llvm.org
Created attachment 20602
--> https://bugs.llvm.org/attachment.cgi?id=20602&action=edit
Test case
The following program:
extern "C" int printf(const char *, ...);
struct Foo {
Foo(int x) { printf("INIT: %d\n", x); }
};
Foo f(1);
Foo f2(2);
Foo f3(3);
__attribute__((init_priority(101)))
Foo g0(101);
__attribute__((init_priority(65534)))
Foo g(65534);
__attribute__((init_priority(65535)))
Foo h(65535);
int main(void) {
return 0;
}
- when compiled with clang++ (5.0.0) displays:
INIT: 101
INIT: 65534
INIT: 65535
INIT: 1
INIT: 2
INIT: 3
- when compiled with g++ (5.4.0) displays:
INIT: 101
INIT: 65534
INIT: 1
INIT: 2
INIT: 3
INIT: 65535
g++ seems to consider that init_priority 655535 happens after standard dynamic
initialization.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs