[lkml]   [2003]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectconst versus __attribute__((const))
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

<> at work, <> 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
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:59    [W:0.047 / U:7.836 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site