From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/635 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: libm Date: Fri, 9 Mar 2012 11:01:04 -0500 Message-ID: <20120309160104.GE184@brightrain.aerifal.cx> References: <20120227222437.GH184@brightrain.aerifal.cx> <20120303225758.GA5728@port70.net> <20120304065340.GT184@brightrain.aerifal.cx> <20120304145041.GB5728@port70.net> <20120304184339.GV184@brightrain.aerifal.cx> <20120305085135.GC5728@port70.net> <20120305140459.GW184@brightrain.aerifal.cx> <20120305151710.GG5728@port70.net> <20120309102239.GC184@brightrain.aerifal.cx> <20120309105703.GT5728@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1331308884 9422 80.91.229.3 (9 Mar 2012 16:01:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 9 Mar 2012 16:01:24 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-636-gllmg-musl=m.gmane.org@lists.openwall.com Fri Mar 09 17:01:23 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1S62Fu-0003IU-GH for gllmg-musl@plane.gmane.org; Fri, 09 Mar 2012 17:01:22 +0100 Original-Received: (qmail 19658 invoked by uid 550); 9 Mar 2012 16:01:22 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 19650 invoked from network); 9 Mar 2012 16:01:21 -0000 Content-Disposition: inline In-Reply-To: <20120309105703.GT5728@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:635 Archived-At: On Fri, Mar 09, 2012 at 11:57:03AM +0100, Szabolcs Nagy wrote: > > 2. You could add something like: > > #ifdef __GNUC__ > > #define __RETCAST(x) (__typeof__((x)) > > #else > > #define __RETCAST(x) > > #endif > > Then add __RETCAST((x)), __RETCAST((x)+(y)), etc. Some trick will be > > needed to make integer types result in a cast to double, though. > > > > ok, that makes sense > > actually i'm not sure when the extra () protection > is needed like __typeof__((x)) > (the reason for it in (x)+(y) is clear) > > is it because single argument macros might get > called with a comma expression? > > so > #define A(x) B((x)) > is ok > > but > #define A(x,y) B((x),(y)) > is redundant It's probably redundant. Only case I can think of where it might help is improving(?) the error reporting when some invalid-as-macro-arg expressions that use ?: as a grouping for a comma operator in the second operand, or perhaps some fishy stuff with compound literals. Rich