comparison src/compiler.h @ 2268:61855263cb07

[xemacs-hg @ 2004-09-14 14:32:29 by james] Identify functions that don't return, including some DEFUNs.
author james
date Tue, 14 Sep 2004 14:33:07 +0000
parents 19b0fcab3f47
children 0be6ff2356c8
comparison
equal deleted inserted replaced
2267:5753220a0f80 2268:61855263cb07
108 # else 108 # else
109 # define PRINTF_ARGS(string_index,first_to_check) 109 # define PRINTF_ARGS(string_index,first_to_check)
110 # endif /* GNUC */ 110 # endif /* GNUC */
111 #endif 111 #endif
112 112
113 #ifndef DOESNT_RETURN 113 #ifndef DOESNT_RETURN_TYPE
114 # if (GCC_VERSION > NEED_GCC (0, 0, 0)) 114 # if (GCC_VERSION > NEED_GCC (0, 0, 0))
115 # if (GCC_VERSION >= NEED_GCC (2, 5, 0)) 115 # if (GCC_VERSION >= NEED_GCC (2, 5, 0))
116 # if (GCC_VERSION < NEED_GCC (3, 0, 0)) 116 # define RETURN_NOT_REACHED(value) DO_NOTHING
117 /* GCC 3.2 -O3 issues complaints in Fcommand_loop_1 about no return 117 # define DOESNT_RETURN_TYPE(rettype) rettype
118 statement if we have this definition */ 118 # define DECLARE_DOESNT_RETURN_TYPE(rettype,decl) rettype decl \
119 # define RETURN_NOT_REACHED(value) DO_NOTHING 119 __attribute__ ((noreturn))
120 # endif
121 # define DOESNT_RETURN void
122 # define DECLARE_DOESNT_RETURN(decl) void decl __attribute__ ((noreturn))
123 # else /* GCC_VERSION < NEED_GCC (2, 5, 0) */ 120 # else /* GCC_VERSION < NEED_GCC (2, 5, 0) */
124 # define DOESNT_RETURN void volatile 121 # define DOESNT_RETURN_TYPE(rettype) rettype volatile
125 # define DECLARE_DOESNT_RETURN(decl) void volatile decl 122 # define DECLARE_DOESNT_RETURN_TYPE(rettype,decl) rettype volatile decl
126 # endif /* GCC_VERSION >= NEED_GCC (2, 5, 0) */ 123 # endif /* GCC_VERSION >= NEED_GCC (2, 5, 0) */
127 # else /* not gcc */ 124 # else /* not gcc */
128 # define DOESNT_RETURN void 125 # define DOESNT_RETURN_TYPE(rettype) rettype
129 # define DECLARE_DOESNT_RETURN(decl) void decl 126 # define DECLARE_DOESNT_RETURN_TYPE(rettype,decl) rettype decl
130 # endif /* GCC_VERSION > NEED_GCC (0, 0, 0) */ 127 # endif /* GCC_VERSION > NEED_GCC (0, 0, 0) */
128 #endif /* DOESNT_RETURN_TYPE */
129 #ifndef DOESNT_RETURN
130 # define DOESNT_RETURN DOESNT_RETURN_TYPE (void)
131 # define DECLARE_DOESNT_RETURN(decl) DECLARE_DOESNT_RETURN_TYPE (void, decl)
131 #endif /* DOESNT_RETURN */ 132 #endif /* DOESNT_RETURN */
132 133
133 /* Another try to fix SunPro C compiler warnings */ 134 /* Another try to fix SunPro C compiler warnings */
134 /* "end-of-loop code not reached" */ 135 /* "end-of-loop code not reached" */
135 /* "statement not reached */ 136 /* "statement not reached */