[Bug 223752] clang __attribute__((constructor)) gets wrong input parameters
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Sun Nov 19 23:56:17 UTC 2017
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223752
--- Comment #7 from dstaesse <dimitri.staessens at ugent.be> ---
(In reply to Mark Millard from comment #5)
Good point, we only tried amd64 and i386.
This feature seems to be very sparsely documented, with some sources saying
everything but void func(void) is undefined behaviour and others stating that
it can have the same signature as the main() function. The GNU compiler
documentation doesn't give details and clang doesn't document it at all. I've
seen other projects use this, though.
The compiler doesn't seem to check the function signature at all, I've tried to
set the constructor attribute to functions with all sorts of parameters and
complaints.
If this is undefined behaviour, do you know of a portable way to access argv
from a shared library without passing it as a function parameter to some init
call?
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-toolchain
mailing list