From owner-freebsd-arch Thu Feb 28 11:25:33 2002 Delivered-To: freebsd-arch@freebsd.org Received: from dragon.nuxi.com (trang.nuxi.com [66.92.13.169]) by hub.freebsd.org (Postfix) with ESMTP id 4A50A37B41B for ; Thu, 28 Feb 2002 11:25:29 -0800 (PST) Received: (from obrien@localhost) by dragon.nuxi.com (8.11.6/8.11.1) id g1SJPG330633; Thu, 28 Feb 2002 11:25:16 -0800 (PST) (envelope-from obrien) Date: Thu, 28 Feb 2002 11:21:12 -0800 From: "David O'Brien" To: Mark Murray Cc: arch@freebsd.org Subject: Re: Warning and lint(1) fixes. Review please. Message-ID: <20020228112112.A30563@dragon.nuxi.com> Reply-To: obrien@freebsd.org Mail-Followup-To: arch@freebsd.org References: <200202281836.g1SIaog4051908@grimreaper.grondar.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200202281836.g1SIaog4051908@grimreaper.grondar.org>; from mark@grondar.za on Thu, Feb 28, 2002 at 06:36:50PM +0000 X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Feb 28, 2002 at 06:36:50PM +0000, Mark Murray wrote: > +#ifdef __GNUC__ > #define ATOMIC_ASM(NAME, TYPE, OP, CONS, V) \ > static __inline void \ > atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\ > @@ -97,6 +98,9 @@ > : "+m" (*p) \ > : CONS (V)); \ > } > +#else > +#define ATOMIC_ASM(NAME, TYPE, OP, CONS, V) > +#endif > > /* > * Atomic compare and set, used by the mutex functions > @@ -112,6 +116,7 @@ > { > int res = exp; > > +#ifdef __GNUC__ > __asm __volatile( > " pushfl ; " > " cli ; " > @@ -127,6 +132,7 @@ > : "r" (src), /* 1 */ > "m" (*(dst)) /* 2 */ > : "memory"); > +#endif Because you are changing obvious syntax errors, if one uses a non-GCC compiler, into things that will silently fail; I would be more comfortable with this change if you kept the errors. Can you add #error in the #else cases? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message