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

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