Subject: Re: ANSI C warning from sys/arch/sparc/include/lock.h
To: Christos Zoulas <christos@tac.gw.com>
From: Greg A. Woods <woods@weird.com>
List: tech-userlevel
Date: 05/05/2005 20:48:55
[ On Tuesday, May 3, 2005 at 16:21:58 (-0400), Christos Zoulas wrote: ]
> Subject: Re: ANSI C warning from sys/arch/sparc/include/lock.h
>
> >/usr/include/machine/lock.h: In function `__cpu_simple_lock_try':
> >/usr/include/machine/lock.h:110: warning: ANSI C forbids braced-groups
> >within expressions
> >
> 
> Which compiler is that

Ah, gcc-2.95.3 of course....  (on netbsd-1.6.x)


> and what versio of lock.h?

it is:

/*      $NetBSD: lock.h,v 1.10 2000/05/05 20:12:00 hannken Exp $ */

and I now see that it's fixed -- for some reason I didn't see the change
from "#define __ldstub" to "static __inline__ int __ldstub"  when I
looked at the diff to -current the other day....

----------------------------
revision 1.14
date: 2003/12/26 06:00:58;  author: mrg;  state: Exp;  lines: +13 -12
branches:  1.14.2;
convert __ldstub() from a ({}) macro into a properly static inline function.
the latter is not valid for C++ so says GCC3.
----------------------------


Sorry about that!

-- 
						Greg A. Woods

H:+1 416 218-0098  W:+1 416 489-5852 x122  VE3TCP  RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>