[Bug 223752] clang __attribute__((constructor)) gets wrong input parameters

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Nov 19 19:33:50 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223752

David Chisnall <theraven at FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |theraven at FreeBSD.org

--- Comment #3 from David Chisnall <theraven at FreeBSD.org> ---
This doesn't look like a bug.  `__attribute__((constructor))` is only defined
for functions that take no arguments (for gcc and clang).  I'm very surprised
if you don't get a compile-time warning.  If `argc`, `argv` and `envp` are
appearing as arguments, it's because, on some platforms / architectures these
happen to be the values in argument registers when the constructors are
invoked, but it's not intended behaviour.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-toolchain mailing list