From: Mark Wielaard Date: Fri, 13 Mar 2015 22:51:40 +0000 (+0100) Subject: Fix -Wimplicit warnings. X-Git-Tag: elfutils-0.162~106 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0a35e3ac65dfd2db4e0ae0f68fdb21493c5fbfa1;p=thirdparty%2Felfutils.git Fix -Wimplicit warnings. --- diff --git a/ChangeLog b/ChangeLog index f81b30227..5c8e1c24e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-03-13 Mark Wielaard + + * configure.ac (ac_cv_c99): Add explicit return. + (ac_cv_tls): Add stdlib.h include. + 2014-12-18 Mark Wielaard * configure.ac: Set version to 0.161. diff --git a/configure.ac b/configure.ac index 0e67a792a..c4b818d02 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. dnl Configure input file for elfutils. -*-autoconf-*- dnl -dnl Copyright (C) 1996-2014 Red Hat, Inc. +dnl Copyright (C) 1996-2015 Red Hat, Inc. dnl dnl This file is part of elfutils. dnl @@ -83,7 +83,7 @@ AC_CACHE_CHECK([for gcc with C99 support], ac_cv_c99, [dnl old_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -std=gnu99" AC_COMPILE_IFELSE([AC_LANG_SOURCE([dnl -int foo (int a) { for (int i = 0; i < a; ++i) if (i % 4) break; int s = a; }])], +int foo (int a) { for (int i = 0; i < a; ++i) if (i % 4) break; int s = a; return s;}])], ac_cv_c99=yes, ac_cv_c99=no) CFLAGS="$old_CFLAGS"]) AS_IF([test "x$ac_cv_c99" != xyes], @@ -97,7 +97,8 @@ save_LDFLAGS="$LDFLAGS" CFLAGS="-fpic $CFLAGS" LDFLAGS="-shared -Wl,-z,defs,-z,relro $LDFLAGS" AC_LINK_IFELSE([dnl -AC_LANG_PROGRAM([[#undef __thread +AC_LANG_PROGRAM([[#include +#undef __thread static __thread int a; int foo (int b) { return a + b; }]], [[exit (foo (0));]])], ac_cv_tls=yes, ac_cv_tls=no) diff --git a/tests/ChangeLog b/tests/ChangeLog index 0162b85e2..82c30e0be 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,9 @@ +2015-03-13 Mark Wielaard + + * backtrace-dwarf.c: Add explicit includes. + (cleanup_13_abort): Remove unused static declaration. + (thread_callback): Add explicit return. + 2015-03-13 H.J. Lu * backtrace.c (prepare_thread): Use PTRACE_GETREGS/PTRACE_SETREGS diff --git a/tests/backtrace-dwarf.c b/tests/backtrace-dwarf.c index 87d088aa4..fbcb22e64 100644 --- a/tests/backtrace-dwarf.c +++ b/tests/backtrace-dwarf.c @@ -1,5 +1,5 @@ /* Test program for unwinding of complicated DWARF expressions. - Copyright (C) 2013 Red Hat, Inc. + Copyright (C) 2013, 2015 Red Hat, Inc. This file is part of elfutils. This file is free software; you can redistribute it and/or modify @@ -22,7 +22,11 @@ #include #include #include +#include +#include #include +#include +#include #include ELFUTILS_HEADER(dwfl) #ifndef __linux__ @@ -37,7 +41,6 @@ main (int argc __attribute__ ((unused)), char **argv) #else /* __linux__ */ -static void cleanup_13_abort (void); #define main cleanup_13_main #include "cleanup-13.c" #undef main @@ -115,7 +118,9 @@ static int thread_callback (Dwfl_Thread *thread, void *thread_arg) { dwfl_thread_getframes (thread, frame_callback, NULL); + /* frame_callback shall exit (0) on success. */ error (1, 0, "dwfl_thread_getframes: %s", dwfl_errmsg (-1)); + return DWARF_CB_ABORT; } int