# endif
# endif
# define MAYBE_UNUSED __attribute__((__unused__))
+# define NORETURN __attribute__((__noreturn__))
#else
# define MAYBE_UNUSED
+# define NORETURN
# if HAVE_ALLOCA_H
# include <alloca.h>
# else
#endif
#ifdef FFI_DEBUG
-void ffi_assert(char *expr, char *file, int line);
+NORETURN void ffi_assert(const char *expr, const char *file, int line);
void ffi_stop_here(void);
-void ffi_type_test(ffi_type *a, char *file, int line);
+void ffi_type_test(ffi_type *a, const char *file, int line);
#define FFI_ASSERT(x) ((x) ? (void)0 : ffi_assert(#x, __FILE__,__LINE__))
#define FFI_ASSERT_AT(x, f, l) ((x) ? 0 : ffi_assert(#x, (f), (l)))
/* Open a temporary file name, and immediately unlink it. */
static int
-open_temp_exec_file_name (char *name, int flags)
+open_temp_exec_file_name (char *name, int flags MAYBE_UNUSED)
{
int fd;
Failure to allocate the space will cause SIGBUS to be thrown when
the mapping is subsequently written to. */
static int
-allocate_space (int fd, off_t offset, off_t len)
+allocate_space (int fd, off_t len)
{
static long page_size;
offset = execsize;
- if (allocate_space (execfd, offset, length))
+ if (allocate_space (execfd, length))
return MFAIL;
flags &= ~(MAP_PRIVATE | MAP_ANONYMOUS);
/* This function should only be called via the FFI_ASSERT() macro */
-void ffi_assert(char *expr, char *file, int line)
+NORETURN void ffi_assert(const char *expr, const char *file, int line)
{
fprintf(stderr, "ASSERTION FAILURE: %s at %s:%d\n", expr, file, line);
ffi_stop_here();
/* Perform a sanity check on an ffi_type structure */
-void ffi_type_test(ffi_type *a, char *file, int line)
+void ffi_type_test(ffi_type *a, const char *file, int line)
{
FFI_ASSERT_AT(a != NULL, file, line);
}
#endif /* NO_MALLINFO */
-void dlmalloc_stats() {
+void dlmalloc_stats(void) {
internal_malloc_stats(gm);
}
}
static void
-ffi_tramp_unlock()
+ffi_tramp_unlock(void)
{
pthread_mutex_unlock (&tramp_globals_mutex);
}
ffi_cif* cif,
void (*fun)(ffi_cif*, void*, void**, void*),
void *user_data,
- void *codeloc)
+ void *codeloc MAYBE_UNUSED)
{
static const unsigned char trampoline[FFI_TRAMPOLINE_SIZE - 8] = {
/* endbr64 */