From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] Re: [Etherboot-developers] __unused in arch/i386/include/hooks.h In-Reply-To: Your message of "Sun, 18 Jan 2004 10:09:27 MST." From: "Russ Cox" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <62232.1074468052.1@t40.swtch.com> Message-Id: Date: Sun, 18 Jan 2004 18:20:52 -0500 Topicbox-Message-UUID: bc5d401c-eacc-11e9-9e20-41e7f4b1d025 > > given the ongoing discussion of C extensions, I thought this one was a > > beaut. Gcc suffers from having multiple versions in use at any given time -- they don't have the luxury we do. But beyond that I don't see anything wrong with how they solved the problem. __unused is a bit long for a name, but since almost all of the USED uses in Plan 9 code are for function parameters, solving the problem this way seems fine to me. Why do you think this is so bad? The only thing I can think of is "it's not the way Plan 9 does it", which by itself isn't such a great reason. > suppressing warnings seems to be a problem few programmers (present on > this list company excluded) manage to tackle successfuly: > > home% cd src/links-ape/ > home% sed -n 223,228p gif.c > accept_code(struct gif_decoder *deco,int c) > { > int k; > > k=k; /* To suppress warning */ > if (c>4096||c<0) return; /* Erroneous code word will be ignored */ > home% > > Plan 9 has USED(). I'm not sure that Links is representative of anything. The fact is that there are no portable ways to silence compiler warnings, so people resort to compiler-specific hacks like "k=k" or "SET(k)". I still don't see why Plan 9 is any different, except that maybe (maybe!) its compiler-specific hacks smell a little nicer. > Interestingly enough, in the lunix version of Plan > 9's libraries USED() works on a single argument only :) And? Russ