This is the mail archive of the gcc-bugs@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: Problems with inline functions


Geoff Keating wrote:
> 
> George Anzinger <george@pioneer.net> writes:
> 
> > ... I think it would be nice to defer compiling
> > inline functions until they are actually used in normal code.  This
> > would make writing header files that have inline functions MUCH easier
> > to manage.
> 
> This would violate the C standard.  The diagnostics you're seeing are
> required.

Then the C standard says something like "non-locals in an inline
function are references to the environment that exists at the time the
function "appears" in the source stream"?  This sounds confusing to me,
however, given that the standard says what it does, is there some neat
trick (short of using macros) that will get the desired effect?  I have
come across cases where it was impossible to get the correct ordering
and resorted to a dummy structure and a cast to allow a forward
reference to a structure.  (Of course, by impossible I mean without
major rewrite of the offending header files.)

In short I needed a way to forward reference a structure offset.

George

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