Re: Looking for definition of inw and/or __inw on x86

Ian Collier (imc@comlab.ox.ac.uk)
Thu, 10 Sep 1998 17:26:50 +0100 (BST)


On 8 Sep 1998 18:14:22 GMT, H. Peter Anvin said:
> Followup to: <00ad01bddb0a$f525e820$04c809c0@Fake.Domain.com>
> By author: "Anthony Barbachan" <barbacha@trill.cis.fordham.edu>
> > This leads to another question, why in the world are the INLINED
> > functions in asm-i386/io.h declared as extern?

> To keep gcc from generating a copy of the function body for every
> single module just in case some luser compiles without -O.

So why isn't it declared "static inline"?

That way, if you compile it with optimisation then gcc will inline it and
not output a separate copy of the function (because it was declared static
and all instances were inlined). If you compile it without optimisation
then gcc will output a copy of the function in every module which uses it
(but apparently not in modules that don't). But that's OK since you didn't
ask for the code to be optimised.

imc

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/faq.html