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]
Other format: [Raw text]

Re: C compile time


> Here is an idiom widely used in the LLVM code base, for example:
> http://llvm.cs.uiuc.edu/doxygen/GCSE_8cpp-source.html

Is this guaranteed to work? I mean, how can the address of a function with 
static linkage be used in a virtual function table? (I think it should work, 
since the vt can only be set up in this very file, but still...)


> Besides the fact that my project would benefit a lot from this, if there
> is no reason to not mark the methods static, we should. 

If the class itself is declared in a an anonymous namespace, I agree.

Not that I'm opposed to your proposal, it's just that I don't see a whole lot 
of code out there that uses this idiom. I wouldn't want to trade this feature 
against another 10% slowdown in the compiler ;-)

W.

-------------------------------------------------------------------------
Wolfgang Bangerth              email:            bangerth@ices.utexas.edu
                               www: http://www.ices.utexas.edu/~bangerth/


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