2014-12-09 14:24 GMT+01:00 John E. / TDM <[email protected]>:

> On 12/8/2014 11:29 PM, Greg Jung wrote:
> > Hi John,
> >   If you would indulge my questions, I am intrigued by the advice re:
> > "-fno-keep-inline-dllexport" flag
> > because it mentions wxWidgets which I am trying to incorporate into an
> > already-large program.
> > Do you know what problem it addresses, is it needed to unclutter a
> > namespace?
>
> Hi Greg,
>
> GCC versions before 4.5 didn't emit class member functions into DLLs if
> they were declared with the "inline" keyword. This tended not to be a
> problem, because their full definition is available and inlinable to any
> user of the class. But as of 4.5 GCC was changed to match Microsoft
> Visual C/C++ behavior by also emitting said functions into the DLL.
>
> The more inline class member functions, the more memory it takes to link
> the DLL. wxWidgets grew big enough that when the 4.5 change came around,
> suddenly there were too many inline class member functions to fit in
> link-time memory, and the linker would fail.
>
> The "-fno-keep-inline-dllexport" option reverts to pre-4.5 behavior by
> not emitting inline class member functions into a DLL, allowing software
> like wxWidgets (monolithic) to link successfully. The only downsides to
> using it are that it breaks Microsoft compatibility (almost always not a
> problem with C++), and that you can't take the address in the DLL of one
> of said functions (which you shouldn't be doing anyway for inlines).
>

In my never-ending war on misconceptions regarding C++:
1. inline does not tell your compiler to inline. It is merely a hint and
the fact that some compilers take it as a serious hint is a coincidence.
Nothing in the C or C++ language says there is even the slightest
guarantee. The point of inline is to be able to write inline definitions of
functions, and respect the One Definition Rule. But you knew that already I
suppose ;-)
2. There is absolutely no problem in taking the address of an inline
function. It is very legal. See for example
http://stackoverflow.com/q/3318322/256138
3. I do believe this compiler option makes GCC behave in a non-standard
way, but I haven't checked that myself.

Nevertheless, since ld is too inefficient, this option was necessary to
make it work for stuff like wxWidgets (Qt also added the option to its
build).

Cheers,

Ruben


> > Also regarding
> > TDM, how many hooks into the windows registry does it maintain?  I
> > un-installed a TDM from a previous system and was dismayed at what
> > seemed like 2,000 entries in the registry wind-down - am I
> > hallucinating that?
>
> You are. The TDM-GCC installer intentionally avoids the registry like
> the plague. All is done through file magic. :)
>
> -John E. / TDM
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
>
> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
> _______________________________________________
> Mingw-w64-public mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to