From xemacs-m  Thu Mar 13 02:38:47 1997
Received: from venus.Sun.COM (venus.Sun.COM [192.9.25.5])
	by xemacs.org (8.8.5/8.8.5) with SMTP id CAA19937
	for <xemacs-beta@xemacs.org>; Thu, 13 Mar 1997 02:38:46 -0600 (CST)
Received: from Eng.Sun.COM ([129.146.1.25]) by venus.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id AAA00229; Thu, 13 Mar 1997 00:38:16 -0800
Received: from kindra.eng.sun.com by Eng.Sun.COM (SMI-8.6/SMI-5.3)
	id AAA13430; Thu, 13 Mar 1997 00:38:14 -0800
Received: from xemacs.eng.sun.com by kindra.eng.sun.com (SMI-8.6/SMI-SVR4)
	id AAA26739; Thu, 13 Mar 1997 00:38:14 -0800
Received: by xemacs.eng.sun.com (SMI-8.6/SMI-SVR4)
	id AAA00861; Thu, 13 Mar 1997 00:38:11 -0800
Date: Thu, 13 Mar 1997 00:38:11 -0800
Message-Id: <199703130838.AAA00861@xemacs.eng.sun.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: Martin Buchholz <mrb@Eng.Sun.COM>
To: Kyle Jones <kyle_jones@wonderworks.com>
Cc: xemacs-beta@xemacs.org
Subject: RETURN_UNGCPRO
In-Reply-To: <QQcghe00106.199703101637@crystal.WonderWorks.COM>
References: <QQcghe00106.199703101637@crystal.WonderWorks.COM>
Reply-To: Martin Buchholz <mrb@Eng.Sun.COM>

>>>>> "Kyle" == Kyle Jones <kyle_jones@wonderworks.com> writes:

Kyle> The Solaris 2.5.1 compiler warns about every use of
Kyle> RETURN_UNGCPRO

Kyle> "fileio.c", line 2265: warning: end-of-loop code not reached

Kyle> if anyone cares about such things.  I suppose from the compiler's
Kyle> point of view calling 'return' unconditionally inside a do-while
Kyle> loop is a pretty dim-bulb thing to do, but how could the compiler
Kyle> anticipate XEmacs' Creative Use of Macros?

I care about such things.  SunPro C is a pretty good compiler, but the
single worst things about it is that the following used to generate
warnings.  During 19.14 I attempted to reach zero warning
compilations, but we're still not quite there yet.


#define RETURN_UNGCPRO(expr) do						\
{									\
  Lisp_Object ret_ungc_val = (expr);					\
  UNGCPRO;								\
  return ret_ungc_val;							\
} while (0)


Anyways, I did this gross hack just for SunPro C:


/* Another try to fix SunPro C compiler warnings */
/* "end-of-loop code not reached" */
/* "statement not reached */
#ifdef __SUNPRO_C
#define RETURN__ if (1) return
#define RETURN_NOT_REACHED(value)
#else
#define RETURN__ return
#define RETURN_NOT_REACHED(value) return value;
#endif

/* Evaluate expr, UNGCPRO, and then return the value of expr.  */
#define RETURN_UNGCPRO(expr) do						\
{									\
  Lisp_Object ret_ungc_val = (expr);					\
  UNGCPRO;								\
  RETURN__ ret_ungc_val;						\
} while (0)


Did this hack stop working??

Martin

