From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Sat, 12 Nov 2005 11:37:23 -0500 From: Russ Cox To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] USED() macro In-Reply-To: <1131806556.7582.86.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <1131789636.7582.55.camel@localhost.localdomain> <0127f0e483812bde9207dcadeb8a009f@terzarima.net> <1131806556.7582.86.camel@localhost.localdomain> Topicbox-Message-UUID: ab882226-ead0-11e9-9d60-3106f5b1d025 > 1) X headers are in /usr/include/X11 only. No 'include' in $X11, not > even a link. So, $PLAN9/src/libdraw/mkwsysrules.sh could not find them; > and set $WSYSTYPE to 'nowsys'. As a result nowsys-*.c get compiled, and > I noticed USED() there. Fixed. > 2) install(1) says: > > > If LOCAL.config contains a line WSYS=3Dnowsys then the system is built > > without using X11. > > I guess it might be WSYSTYPE=3Dnowsys? Fixed. > 3) 9c uses gcc, but USED() is still defined as if(x){}else{}, not the > version with __attribute__ ((unused)). When I added -D__GNUC__ in 9c, it > complained for redefinition. Why not > > #ifdef __GNUC__ > # if __GNUC__ >=3D 3 > # undef USED > # define USED(x) { ulong __y __attribute__ ((unused= )); __y =3D > (ulong)(x); } > # endif > #endif > > functioning correctly? It probably is functioning correctly. You still can't do Rectangle r; USED(r); with that definition because you can't cast a Rectangle to a ulong. I could change the definition for __GNUC__>=3D3 but then it would allow non-scalar USED but all the other platforms would not, so then I'd be getting reports from the non-gcc users. I'd rather all the platforms be consistent. If you're not seeing a warning about the variable never being used or being set and not used, then it's functioning fine. Russ