diff libcruft/misc/f77-fcn.h @ 15127:87411930d6c4

avoid "function declared 'noreturn' has a return statement" warning. * configure.ac (HAVE_ATTR_DEPRECATED, HAVE_ATTR_NORETURN, HAVE_ATTR_UNUSED): New macros, corresponding to GCC_ATTR_DEPRECATED, GCC_ATTR_NORETURN, and GCC_ATTR_UNUSED. * libcruft/misc/f77-fcn.c (xstopx): Use F77_NORETURN instead of F77_RETURN. * libcruft/misc/f77-fcn.h (F77_RETURN): New macro.
author John W. Eaton <jwe@octave.org>
date Wed, 08 Aug 2012 10:27:59 -0400
parents 72c96de7a403
children 4d52239daef5
line wrap: on
line diff
--- a/libcruft/misc/f77-fcn.h	Wed Aug 08 07:23:21 2012 -0700
+++ b/libcruft/misc/f77-fcn.h	Wed Aug 08 10:27:59 2012 -0400
@@ -108,6 +108,11 @@
 
 #define F77_RET_T int
 #define F77_RETURN(retval) return retval;
+#if defined (HAVE_ATTR_NORETURN)
+#define F77_NORETURN(retval)
+#else
+#define F77_NORETURN(retval) return retval;
+#endif
 
 /* FIXME -- these should work for SV1 or Y-MP systems but will
    need to be changed for others.  */
@@ -176,7 +181,8 @@
 #define F77_CHAR_ARG_LEN_USE(s, len) len
 
 #define F77_RET_T void
-#define F77_RETURN(retval)
+#define F77_RETURN(retval) return;
+#define F77_NORETURN(retval)
 
 #else
 
@@ -203,6 +209,11 @@
 
 #define F77_RET_T int
 #define F77_RETURN(retval) return retval;
+#if defined (HAVE_ATTR_NORETURN)
+#define F77_NORETURN(retval)
+#else
+#define F77_NORETURN(retval) return retval;
+#endif
 
 #endif