From xemacs-m  Thu Mar 13 13:33:51 1997
Received: from mailbox1.ucsd.edu (mailbox1.ucsd.edu [132.239.1.53])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id NAA04426
	for <xemacs-beta@xemacs.org>; Thu, 13 Mar 1997 13:33:47 -0600 (CST)
Received: from sdnp5.ucsd.edu (sdnp5.ucsd.edu [132.239.79.10]) by mailbox1.ucsd.edu (8.8.5/8.6.9) with SMTP id LAA01792 for <xemacs-beta@xemacs.org>; Thu, 13 Mar 1997 11:33:49 -0800 (PST)
Received: by sdnp5.ucsd.edu (SMI-8.6/SMI-SVR4)
	id LAA03937; Thu, 13 Mar 1997 11:35:52 -0800
Sender: dmoore@sdnp5.ucsd.edu
TO: xemacs-beta@xemacs.org
Subject: Re: RETURN_UNGCPRO
References: <9703131812.AA12062@thymus.synaptics.com>
X-Face: "oX;zS#-JU$-,WKSzG.1gGE]x^cIg!hW.dq>.f6pzS^A+(k!T|M:}5{_%>Io<>L&{hO7W4cicOQ|>/lZ1G(m%7iaCf,6Qgk0%%Bz7b2-W3jd0m_UG\Y;?]}4s0O-U)uox>P3JN)9cm]O\@,vy2e{`3pb!"pqmRy3peB90*2L
Mail-Copies-To: never
Mime-Version: 1.0 (generated by tm-edit 7.105)
Content-Type: multipart/mixed;
 boundary="Multipart_Thu_Mar_13_11:35:52_1997-1"
Content-Transfer-Encoding: 7bit
From: David Moore <dmoore@ucsd.edu>
Date: 13 Mar 1997 11:35:52 -0800
In-Reply-To: Dave Gillespie's message of Thu, 13 Mar 97 10:12:26 -0800
Message-ID: <rv67yvzisn.fsf@sdnp5.ucsd.edu>
Lines: 56
X-Mailer: Gnus v5.4.24/XEmacs 19.15

--Multipart_Thu_Mar_13_11:35:52_1997-1
Content-Type: text/plain; charset=US-ASCII

Dave Gillespie <daveg@synaptics.com> writes:

>   #define RETURN_UNGCPRO(expr) if (0) ; else                              \
>   {                                                                       \
>     Lisp_Object ret_ungc_val = (expr);                                    \
>     UNGCPRO;                                                              \
>     return ret_ungc_val;                                                  \
>   }            

    if (foo)
      RETURN_UNGCPRO(foo);
    else
      abort();

expands to:

    if (foo)
      if (0) ; else { STUFF; };
    else
      abort();

Which isn't legal C.  I personally think compilers which want to complain
about things like this (which is good) should know common programming
idioms and transfer more information out of the "cpp" stage to the
"compiler".  If they see macros which look like `do {STUFF} while (0}'
or my other favourite `(0, STUFF)', then they should just shut up.

I like to compile things with every warning turned on, since it does
help fix subtle problems.  But it's not serving it's purpose well when
it's warning about things that are actually making the program safer.
People get sick of the warnings and just turn them off.


--Multipart_Thu_Mar_13_11:35:52_1997-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="anal-gcc"
Content-Transfer-Encoding: 7bit

#!/bin/sh

exec gcc -pedantic -Wall -Wtraditional -Wshadow -Wpointer-arith -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Winline -Waggregate-return $*


--Multipart_Thu_Mar_13_11:35:52_1997-1
Content-Type: text/plain; charset=US-ASCII

-- 
David Moore <dmoore@ucsd.edu>       | Computer Systems Lab      __o
UCSD Dept. Computer Science - 0114  | Work: (619) 534-8604    _ \<,_
La Jolla, CA 92093-0114             | Fax:  (619) 534-1445   (_)/ (_)
<URL:http://oj.egbt.org/dmoore/>    | In a cloud bones of steel.

--Multipart_Thu_Mar_13_11:35:52_1997-1--

