Re: Mark bitrevX() functions as const

From: Linus Torvalds
Date: Mon Dec 11 2006 - 11:34:43 EST




On Mon, 11 Dec 2006, David Howells wrote:
>
> Ah. I thought that was just for supporting old versions of gcc. I didn't
> realise it was for handling strange compilers.

I'm not sure how much (if at all) the Intel compiler is actually used, and
for all I know it may even support __attribute__((__const__)) these days,
but I like the notion of allowing us to support other compilers, so the
infrastructure is all set up for that.

The main <linux/compiler.h> thing includes various per-compiler headers,
and then defaults some things to be empty if the compiler-specific header
doesn't have its own #define for it. So it's actually set up to try to
help more than just gcc or the Intel compiler, although nobody has done
anything else afaik.

I think all versions of gcc support the __attribute__((const)) thing (and
indeed, it's in the "generic" gcc header file, not the per-gcc-version
one).

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