Re: [PATCH] Generic dead function optimisation

Graham Stoney (greyham@research.canon.com.au)
Wed, 26 Apr 2000 18:22:03 +1000 (EST)


Keith Owens wrote:
> Not to mention this case:
>
> static int do_something(void) {...}
> EXPORT_SYMBOL(do_something);
>
> Perfectly legal because of the way that the kernel handles exported
> symbols.

Sure, but do_something isn't unused in this case anyway, because EXPORT_SYMBOL
creates a reference to it.

Jeff Garzik writes:
> I would prefer that such a case be perfect illegal..

I think it would be much nicer to have a mechanism for specifying that a symbol
should be exported in its definition, rather than using the EXPORT_SYMBOL hack.
Something along the lines of:

int __export do_something(void) {...}

I haven't worked out if __attribute__ has the magic required to pull this off,
but I'm open to suggestions.

Regards,
Graham

-- 
Graham Stoney
Principal Hardware/Software Engineer
Canon Information Systems Research Australia
Ph: +61 2 9805 2909  Fax: +61 2 9805 2929

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