Re: [PATCH] Generic dead function optimisation

From: Martin Mares (mj@suse.cz)
Date: Tue Apr 25 2000 - 07:51:59 EST


Hello!

> Not only that, it violates longstanding C semantics.
>
> "static" => "can not be referenced outside this compilation unit"
> "EXPORT_SYMBOL" => "can be referenced outside this compilation unit"

If "referenced" means "referenced by its name" and not "called", then
yes. But the EXPORT_SYMBOL case is equivalent to making a non-static
data structure contain a pointer to your static function which is
perfectly normal C. For example:

        static void f(void)
        {
        }

        void (*pf)(void) = f;

and then (in another compilation unit)

        pf();

is obviously correct.

                                Have a nice fortnight

-- 
Martin `MJ' Mares <mj@ucw.cz> <mj@suse.cz> http://atrey.karlin.mff.cuni.cz/~mj/
"ADA -- A Dumb Acronym"

- 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/



This archive was generated by hypermail 2b29 : Sun Apr 30 2000 - 21:00:09 EST