From xemacs-m  Thu Mar 13 14:40:40 1997
Received: from synaptics.synaptics.com (synaptics.synaptics.com [207.92.223.3])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id OAA05235
	for <xemacs-beta@xemacs.org>; Thu, 13 Mar 1997 14:40:23 -0600 (CST)
Received: (from mail@localhost) by synaptics.synaptics.com (8.7.5/8.7.3) id LAA26605 for <xemacs-beta@xemacs.org>; Thu, 13 Mar 1997 11:38:11 -0800 (PST)
X-Authentication-Warning: synaptics.synaptics.com: mail set sender to <daveg@thymus> using -f
Received: from synaptx.synaptics.com(192.147.44.16) by synaptics.synaptics.com via smap (V1.3)
	id sma026603; Thu Mar 13 11:37:53 1997
Received: from thymus.synaptics.com by synaptx.synaptics.com (4.1/SMI-4.1)
	id AA13531; Thu, 13 Mar 97 12:37:51 PST
Received: by thymus.synaptics.com (4.1/SMI-4.1)
	id AA12169; Thu, 13 Mar 97 12:37:44 PST
Message-Id: <9703132037.AA12169@thymus.synaptics.com>
To: xemacs-beta@xemacs.org
Subject: Re: RETURN_UNGCPRO 
In-Reply-To: Your message of "13 Mar 97 11:35:52 PST."
             <rv67yvzisn.fsf@sdnp5.ucsd.edu> 
Reply-To: daveg@synaptics.com
Date: Thu, 13 Mar 97 12:37:43 -0800
From: Dave Gillespie <daveg@synaptics.com>

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

And David Moore sagely pointed out that it didn't solve the
problem.  Oops!  Don't listen to what I said, listen to what I
was thinking... :-)  I.e., something more like this:

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

The "(void)0" is optional, strictly speaking, but leaving it out
leads to some pretty gruesome bugs if you ever forget to follow
the macro call with a semicolon.

The "(void)" cast will confuse really ancient C compilers, but
omitting the cast is just begging for more stupid compiler warnings.

								-- Dave

