diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index bad8540..c0cd39c 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -10503,7 +10503,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, /* PR 21523: Use an absolute value. The user of this reloc will have already selected an ADD or SUB insn appropriately. */ - value = labs (relocation); + value = llabs (relocation); if (value >= 0x1000) return bfd_reloc_overflow; diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index a885efe..d8a46f0 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -879,7 +879,7 @@ now_it_compatible (int cond) return (cond & ~1) == (now_it.cc & ~1); } -static inline int +static inline __attribute__((unused)) int conditional_insn (void) { return inst.cond != COND_ALWAYS; @@ -24205,7 +24205,7 @@ md_apply_fix (fixS * fixP, { bfd_vma insn; bfd_vma encoded_addend; - bfd_vma addend_abs = abs (value); + bfd_vma addend_abs = llabs (value); /* Check that the absolute value of the addend can be expressed as an 8-bit constant plus a rotation. */ @@ -24246,7 +24246,7 @@ md_apply_fix (fixS * fixP, if (!seg->use_rela_p) { bfd_vma insn; - bfd_vma addend_abs = abs (value); + bfd_vma addend_abs = llabs (value); /* Check that the absolute value of the addend can be encoded in 12 bits. */ @@ -24285,7 +24285,7 @@ md_apply_fix (fixS * fixP, if (!seg->use_rela_p) { bfd_vma insn; - bfd_vma addend_abs = abs (value); + bfd_vma addend_abs = llabs (value); /* Check that the absolute value of the addend can be encoded in 8 bits. */ @@ -24325,7 +24325,7 @@ md_apply_fix (fixS * fixP, if (!seg->use_rela_p) { bfd_vma insn; - bfd_vma addend_abs = abs (value); + bfd_vma addend_abs = llabs (value); /* Check that the absolute value of the addend is a multiple of four and, when divided by four, fits in 8 bits. */ diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c index 0124422..29c37c4 100644 --- a/gas/config/tc-microblaze.c +++ b/gas/config/tc-microblaze.c @@ -907,7 +907,8 @@ md_assemble (char * str) unsigned reg2; unsigned reg3; unsigned isize; - unsigned int immed, temp; + unsigned int immed = 0; + unsigned int temp; expressionS exp; char name[20]; diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c index 692a187..70215bf 100644 --- a/gas/config/tc-sparc.c +++ b/gas/config/tc-sparc.c @@ -1220,7 +1220,7 @@ in_signed_range (bfd_signed_vma val, bfd_signed_vma max) /* Return non-zero if VAL is in the range 0 to MAX. */ -static inline int +static inline __attribute__((unused)) int in_unsigned_range (bfd_vma val, bfd_vma max) { if (val > max) diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c index d24c028..a7aba6d 100644 --- a/gdb/amd64-linux-nat.c +++ b/gdb/amd64-linux-nat.c @@ -24,7 +24,7 @@ #include "elf/common.h" #include #include "nat/gdb_ptrace.h" -#include +#include #include #include "gregset.h" #include "gdb_proc_service.h" @@ -40,6 +40,11 @@ #include "nat/linux-ptrace.h" #include "nat/amd64-linux-siginfo.h" +#ifndef ARCH_GET_FS +#define ARCH_GET_FS 0x1003 +#define ARCH_GET_GS 0x1004 +#endif + /* This definition comes from prctl.h. Kernels older than 2.5.64 do not have it. */ #ifndef PTRACE_ARCH_PRCTL diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c index cf24789..9236e57 100644 --- a/gdb/amd64-linux-tdep.c +++ b/gdb/amd64-linux-tdep.c @@ -372,7 +372,7 @@ amd64_all_but_ip_registers_record (struct regcache *regcache) static enum gdb_syscall amd64_canonicalize_syscall (enum amd64_syscall syscall_number) { - switch (syscall_number) { + switch ((int)syscall_number) { case amd64_sys_read: case amd64_x32_sys_read: return gdb_sys_read; diff --git a/gdb/common/environ.c b/gdb/common/environ.c index 698bda3..438be4a 100644 --- a/gdb/common/environ.c +++ b/gdb/common/environ.c @@ -104,7 +104,7 @@ gdb_environ::set (const char *var, const char *value) /* Insert the element before the last one, which is always NULL. */ m_environ_vector.insert (m_environ_vector.end () - 1, - concat (var, "=", value, NULL)); + concat (var, "=", value, nullptr)); } /* See common/environ.h. */ diff --git a/gdb/compile/compile-loc2c.c b/gdb/compile/compile-loc2c.c index ead1003..750b0d7 100644 --- a/gdb/compile/compile-loc2c.c +++ b/gdb/compile/compile-loc2c.c @@ -666,7 +666,8 @@ do_compile_dwarf_expr_to_c (int indent, string_file &stream, while (op_ptr < op_end) { enum dwarf_location_atom op = (enum dwarf_location_atom) *op_ptr; - uint64_t uoffset, reg; + uint64_t uoffset = 0; + uint64_t reg; int64_t offset; print_spaces (indent - 2, &stream); diff --git a/gdb/configure b/gdb/configure index 755e3dc..c799175 100755 --- a/gdb/configure +++ b/gdb/configure @@ -15158,7 +15158,7 @@ build_warnings="-Wall -Wpointer-arith \ # GCC versions complain about %I64. case "${host}" in *-*-mingw32*) build_warnings="$build_warnings -Wno-format" ;; - *) build_warnings="$build_warnings -Wformat-nonliteral" ;; + *) build_warnings="$build_warnings" ;; esac # Check whether --enable-build-warnings was given. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index fae3b62..a6061d8 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -21997,7 +21997,7 @@ dwarf_decode_macro_bytes (bfd *abfd, /* Note that we rely on the fact that the corresponding GNU and DWARF constants are the same. */ - switch (macinfo_type) + switch ((int)macinfo_type) { /* A zero macinfo type indicates the end of the macro information. */ @@ -22314,7 +22314,7 @@ dwarf_decode_macros (struct dwarf2_cu *cu, unsigned int offset, /* Note that we rely on the fact that the corresponding GNU and DWARF constants are the same. */ - switch (macinfo_type) + switch ((int)macinfo_type) { /* A zero macinfo type indicates the end of the macro information. */ diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index 4e0080e..1b39326 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -402,10 +402,10 @@ IPA_OBJS = \ ${IPA_DEPFILES} IPA_LIB = libinproctrace.so - +INTERNAL_CFLAGS_NON_STATIC = `echo " $(INTERNAL_CFLAGS) " | sed "s/ -static//g"` $(IPA_LIB): $(IPA_OBJS) ${ADD_DEPS} ${CDEPS} rm -f $(IPA_LIB) - $(CC_LD) -shared -fPIC -Wl,--soname=$(IPA_LIB) -Wl,--no-undefined $(INTERNAL_CFLAGS) \ + $(CC_LD) -shared -fPIC -Wl,--soname=$(IPA_LIB) -Wl,--no-undefined $(INTERNAL_CFLAGS_NON_STATIC) \ $(INTERNAL_LDFLAGS) -o $(IPA_LIB) ${IPA_OBJS} -ldl -pthread # Put the proper machine-specific files first, so M-. on a machine diff --git a/gdb/nat/linux-waitpid.c b/gdb/nat/linux-waitpid.c index bf5e725..e3305bc 100644 --- a/gdb/nat/linux-waitpid.c +++ b/gdb/nat/linux-waitpid.c @@ -34,19 +34,20 @@ /* Print debugging output based on the format string FORMAT and its parameters. */ +#ifdef GDBSERVER +#define linux_debug(format, ...) \ +do { \ + if (debug_threads) \ + { \ + fprintf (stderr, format, __VA_ARGS__); \ + } \ +} while (0) +#else static inline void linux_debug (const char *format, ...) { -#ifdef GDBSERVER - if (debug_threads) - { - va_list args; - va_start (args, format); - vfprintf (stderr, format, args); - va_end (args); - } -#endif } +#endif /* Convert wait status STATUS to a string. Used for printing debug messages only. */ diff --git a/gdb/warning.m4 b/gdb/warning.m4 index 0b6aaab..a1761a7 100644 --- a/gdb/warning.m4 +++ b/gdb/warning.m4 @@ -47,7 +47,7 @@ build_warnings="-Wall -Wpointer-arith \ # GCC versions complain about %I64. case "${host}" in *-*-mingw32*) build_warnings="$build_warnings -Wno-format" ;; - *) build_warnings="$build_warnings -Wformat-nonliteral" ;; + *) build_warnings="$build_warnings" ;; esac AC_ARG_ENABLE(build-warnings,