Re: 2.4.5 gcc3 build patch

Andrea Arcangeli (andrea@suse.de)
Wed, 13 Jun 2001 02:12:42 +0200


On Tue, Jun 12, 2001 at 04:27:33PM -0700, Richard Henderson wrote:
> We fixed a bug in cv-qualification checking.
>
> timer.c:35: conflicting types for `xtime'
> include/linux/sched.h:540: previous declaration of `xtime'
>
> There's no need for the volatile qualification here. One, being a
> struct it doesn't do any good, and two it's protected by xtime_lock.

wrong, the sec field of xtime is read all the time without any lock.
so xtime can change under you it has to be declared volatile or C
language will screwup. gcc 3.0 effectively spotted a bug in the kernel
that wasn't exporting xtime as volatile.

Right fix is this that I did just about 10 minutes ago after the 3.0
checkout ;)

ftp://ftp.kernel.org/pub/linux/kernel/people/andrea/kernels/v2.4/2.4.6pre2aa2/00_gcc-30-volatile-xtime-1

Andrea
-
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/