Messages in this thread | | | From | David Howells <> | Subject | Re: Mark bitrevX() functions as const | Date | Mon, 11 Dec 2006 13:14:42 +0000 |
| |
Jeff Garzik <jeff@garzik.org> wrote:
> * overall, I agree with this type of change. several Linux lib functions > could use this sort of annotation.
Yes. I just happened to notice bitrev.c at the end of my git pull and wondered if it was what it sounded like...
> * I question its usefulness on static [inline] functions, because the compiler > should be able to figure out side effects. have you examined before-and-after > asm to see if the code generation changes for the inlined area?
It doesn't actually make any difference, but I think such functions should be so marked anyway: it gives both the code writer and the compiler more information (though they're both free to ignore it if they like).
> * naked __attribute__ is ugly. define something short and memorable in > include/linux/compiler.h.
I'm not sure that's a good idea. You have to be careful not to cause confusion with ordinary "const".
> * another annotation to consider is C99 keyword 'restrict'.
Indeed, though I presume you don't mean in this particular case...
David - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |