Re: Why does test_bit() take a volatile addr?

From: Stephen Rothwell
Date: Mon Sep 16 2013 - 02:54:12 EST


Hi Rusty,

On Mon, 16 Sep 2013 13:38:35 +0930 Rusty Russell <rusty@xxxxxxxxxxxxxxx> wrote:
>
> Predates git, does anyone remember the rationale?
>
> ie:
> int test_bit(int nr, const volatile unsigned long *addr)

Because we sometimes pass volatile pointers to it and gcc will complain
if you pass a volatile to a non volatile (I think).

--
Cheers,
Stephen Rothwell sfr@xxxxxxxxxxxxxxxx

Attachment: pgp00000.pgp
Description: PGP signature