Messages in this thread | | | From | "H. Peter Anvin" <> | Subject | const versus __attribute__((const)) | Date | 7 Dec 2003 17:19:46 -0800 |
| |
I have been chasing down a bunch of warnings that have been annoying me, and I have observed that a bunch of the byteorder functions are defined in ways similar to:
static __inline__ __const__ __u16 ___arch__swab16(__u16 value)
With -W -Wall at least gcc 3.2.2 will issue a warning:
warning: type qualifiers ignored on function return type
... which seems to imply the __const__ is ignored. Reading the gcc documentation it appears the correct syntax is __attribute__((__const__)) rather than __const__.
I have made a patch against the current tree defining __attribute_const__ in <linux/compiler.h> and using it in the above cases; does anyone know any reason why I should *NOT* submit this to Linus?
-hpa -- <hpa@transmeta.com> at work, <hpa@zytor.com> in private! If you send me mail in HTML format I will assume it's spam. "Unix gives you enough rope to shoot yourself in the foot." Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64 - 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/
| |