This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: is #pragma interface still needed ?
- To: dyoung at vviuh221 dot vvi dot com
- Subject: Re: is #pragma interface still needed ?
- From: Joe Buck <jbuck at synopsys dot COM>
- Date: Fri, 5 Nov 99 9:03:13 PST
- Cc: gcc at gcc dot gnu dot org
> 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.