This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: is #pragma interface still needed ?



> A long time ago:
> #pragma interface
> was needed in our g++ header files.
> The pragma was documented as a pragma soon to go away because it wouldn't be  
> needed at a future date.
> 
> Does that pragma do anything in egcs?

egcs is gcc now.

The reason for having #pragma interface in the first place was to have a
way of getting only one copy of the virtual function table and "outlined"
copies of inline functions, even when a header is included in multiple
files.

But this is no longer needed, because for a long time now g++ implements
a technique first used in cfront: the virtual function table and any
"outlined" copies of member functions are implemented in the .o file
that contains the definition of the first non-inlined virtual function
of the class.  Most C++ compilers use this trick now.

So the pragma still does something, but it's no longer needed.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]