[strongSwan] why not use gcc extension to facilitate us

Martin Willi martin at strongswan.org
Wed Oct 17 10:22:15 CEST 2012


Hi,

> I find lots of function calls of 'library_init' or 'libhydra_init'
> etc. in the source code.
> why don't we just use the GCC extension '__attribute__
> ((constructor))' and '__attribute__((destructor))' to facilitate our
> work?
> Is there any other concerns?

Yes. The order of invocation of these function relies on different
criteria, including linking order. It is hard to get it correct for all
cases, hence we switch from constructor/destructor to explicit
initialization calls a few years ago.

Regards
Martin





More information about the Users mailing list