lkml.org 
[lkml]   [2003]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][2.6] constant_test_bit doesn't like my gcc
Ingo Oeser <ioe-lkml@rameria.de> wrote:
>
> On Thursday 16 October 2003 06:22, Zwane Mwaikambo wrote:
> > On Wed, 15 Oct 2003, Andrew Morton wrote:
> > > > static __inline__ int constant_test_bit(int nr, const volatile
> > > > unsigned long * addr) {
> > > > - return ((1UL << (nr & 31)) & (((const volatile unsigned int *)
> > > > addr)[nr >> 5])) != 0; + return ((1UL << (nr & 31)) & (addr[nr >> 5]))
> > > > != 0;
> > > > }
> > >
> > > Looks fine. Does your compiler get this right?
> >
> > Yep, thanks.
>
> Sorry, but I still don't get, what a "const volatile" is supposed to mean.

const: this function doesn't alter it

volatile: someone else does modify it, so the compiler needs to avoid
caching it in a register.

-
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:55    [W:0.099 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site