# HG changeset patch # User John W. Eaton # Date 1344436079 14400 # Node ID 87411930d6c40e723378fae281c9e721c55758bb # Parent 25200c04bc252803461dd82f1410a8a0c3cd857c 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. diff -r 25200c04bc25 -r 87411930d6c4 configure.ac --- a/configure.ac Wed Aug 08 07:23:21 2012 -0700 +++ b/configure.ac Wed Aug 08 10:27:59 2012 -0400 @@ -2159,8 +2159,13 @@ #if defined (__GNUC__) #define GCC_ATTR_DEPRECATED __attribute__ ((__deprecated__)) +#define HAVE_ATTR_DEPRECATED + #define GCC_ATTR_NORETURN __attribute__ ((__noreturn__)) +#define HAVE_ATTR_NORETURN + #define GCC_ATTR_UNUSED __attribute__ ((__unused__)) +#define HAVE_ATTR_UNUSED #else #define GCC_ATTR_DEPRECATED #define GCC_ATTR_NORETURN diff -r 25200c04bc25 -r 87411930d6c4 libcruft/misc/f77-fcn.c --- a/libcruft/misc/f77-fcn.c Wed Aug 08 07:23:21 2012 -0700 +++ b/libcruft/misc/f77-fcn.c Wed Aug 08 10:27:59 2012 -0400 @@ -60,5 +60,5 @@ octave_jump_to_enclosing_context (); - F77_RETURN (0) + F77_NORETURN (0) } diff -r 25200c04bc25 -r 87411930d6c4 libcruft/misc/f77-fcn.h --- 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