Re: const from include/asm-i386/byteorder.h

From: Gianni Tedesco (gianni@scaramanga.co.uk)
Date: Mon Jun 02 2003 - 08:21:15 EST


On Mon, 2003-06-02 at 12:51, Nikita Danilov wrote:
> ===== include/linux/compiler.h 1.15 vs edited =====
> --- 1.15/include/linux/compiler.h Wed Apr 9 22:15:46 2003
> +++ edited/include/linux/compiler.h Mon Jun 2 14:44:18 2003
> @@ -56,6 +56,22 @@
> #define __attribute_used__ __attribute__((__unused__))
> #endif
>
> +/* The attribute `pure' is not implemented in GCC versions earlier than 2.96. */
> +#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
> +#define __attribute_pure __attribute__ ((__pure__))
> +#else
> +#define __attribute_pure
> +#endif
> +
> +/* The attribute `const' is not implemented in GCC versions earlier than 2.5. */
> +/* Basically this is just slightly more strict class than the `pure'
> + attribute */
> +#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5)
> +#define __attribute_const __attribute__ ((__const__))
> +#else
> +#define __attribute_const
> +#endif
> +

I think __const_fn and __pure_fn would be a bit more descriptive and
more readable, even though that would appear to go against convention.
It's just that the 'attribute' bit is space consuming and doesn't say
much...

Just my opinion anyway.

-- 
// Gianni Tedesco (gianni at scaramanga dot co dot uk)
lynx --source www.scaramanga.co.uk/gianni-at-ecsc.asc | gpg --import
8646BE7D: 6D9F 2287 870E A2C9 8F60 3A3C 91B5 7669 8646 BE7D


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



This archive was generated by hypermail 2b29 : Sat Jun 07 2003 - 22:00:16 EST