Re: C99 inlines



On Mon, Mar 09, 2009 at 09:55:41PM +1100, Andrew Reilly wrote:
On Sun, Mar 08, 2009 at 03:09:24AM -0400, David Schultz wrote:
My main motivation is that currently there's no easy way to use
non-static inline functions that works with both gcc and other
compilers.

Please pardon my ignorance: what *is* non-static inline
behaviour? I've only ever used static inlines myself: they're
the only sort that make sense (to me), in the world of standard
C static compilation and linkage. What happens elsewhen? Does
the compiler generate a "real" function with an exportable name
that can be linked-to? Why would you want to do that, when
that's what perfectly ordinary functions do? I can't imagine an
extern inline meaning anything useful unless one can do
LLVM-style link-time optimization. Is that on the cards?

With static inline functions you end up with a copy in each object file
where the compiler decided to not inline at least one call, with an
inline function with external linkage all these copies are coalesced to
a single one.
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Types in C
    ... Structs and unions are user-defined. ... definitions without direct compiler support. ... be portable to compilers that don't have inline functions". ...
    (comp.lang.c)
  • Re: VLA question
    ... Just yesterday I was writing an Ising model (about to go on sourceforge). ... inline functions, defined in the header. ... In programming, the trivial is important, because of they way that one ... or migrate to a proper C compiler. ...
    (comp.lang.c)
  • Re: Inline Functions?
    ... that is, it suggests that the compiler ... void __cdecl main ... so the complete body of function func() should actually be placed from ... Maybe inline functions only suggests to the compiler that desired ...
    (comp.lang.c)
  • Re: Critical article on Borland and Free Pascal
    ... >>> rewriting the assembler parts of the RTL. ... > AFAIK they are free to use for compiler vendors, ... Make a lot of choices between backwards compatibility and current ... is a completely different league to implementing inline functions. ...
    (comp.lang.pascal.delphi.misc)
  • Re: XFree86 for athlon problems
    ... > may inline functions not marked as inline causing linking errors, ... packages, including the kernel, even though the rest is i386. ... be nice if the gcc man page would mention this. ... The AIX xlc compiler has rather dire warnings ...
    (linux.redhat)