This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Problems with inline functions
- To: Geoff Keating <geoffk at cygnus dot com>
- Subject: Re: Problems with inline functions
- From: George Anzinger <george at pioneer dot net>
- Date: Mon, 28 Aug 2000 18:51:46 -0700
- Cc: gcc-bugs at gcc dot gnu dot org
- Organization: Monta Vista Software
- References: <39AB11AF.626069D1@pioneer.net> <jmd7isonfa.fsf@envy.cygnus.com>
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