diff options
author | Mark Wielaard <mjw@redhat.com> | 2014-01-23 00:56:41 +0100 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2014-01-30 10:17:15 +0100 |
commit | f48eb6b15fee66e54b488d71738979fc608f25ee (patch) | |
tree | 22be2f2780909d8d61df125b29de5f3f60e52e97 /backends | |
parent | 13968d9aa9990d53999b14494ed55c2d68d4ead5 (diff) | |
download | elfutils-f48eb6b15fee66e54b488d71738979fc608f25ee.tar.gz |
Use -Wformat=2 by default for all files.
This just makes sure that all format strings are given as literals to
printf like functions so the compiler can see and check them. Remove
all no_Wformat, add -Wformat=2 unconditionally to AM_CFLAGS.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
Diffstat (limited to 'backends')
-rw-r--r-- | backends/ChangeLog | 10 | ||||
-rw-r--r-- | backends/Makefile.am | 3 | ||||
-rw-r--r-- | backends/aarch64_regs.c | 30 |
3 files changed, 34 insertions, 9 deletions
diff --git a/backends/ChangeLog b/backends/ChangeLog index a742eb25..0df68195 100644 --- a/backends/ChangeLog +++ b/backends/ChangeLog @@ -1,3 +1,13 @@ +2014-01-22 Mark Wielaard <mjw@redhat.com> + + * Makefile.am (aarch64_regs_no_Wformat): Removed. + * aarch64_regs.c (regtype): Add bool nr argument. snprintf arg + when nr is true. + (regtyper): New function. + (regtypen): Likewise. + (aarch64_register_info): Call either regtyper or regtypen not + regtype directly. + 2014-01-14 Mark Wielaard <mjw@redhat.com> * aarch64_symbol.c (aarch64_check_special_symbol): Check shdr is diff --git a/backends/Makefile.am b/backends/Makefile.am index b8bea36b..90e93a88 100644 --- a/backends/Makefile.am +++ b/backends/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to create Makefile.in ## -## Copyright (C) 2000-2010, 2013 Red Hat, Inc. +## Copyright (C) 2000-2010, 2013, 2014 Red Hat, Inc. ## Copyright (C) 2012 Tilera Corporation ## This file is part of elfutils. ## @@ -86,7 +86,6 @@ aarch64_SRCS = aarch64_init.c aarch64_regs.c aarch64_symbol.c \ aarch64_corenote.c aarch64_retval.c aarch64_cfi.c libebl_aarch64_pic_a_SOURCES = $(aarch64_SRCS) am_libebl_aarch64_pic_a_OBJECTS = $(aarch64_SRCS:.c=.os) -aarch64_regs_no_Wformat = yes sparc_SRCS = sparc_init.c sparc_symbol.c sparc_regs.c sparc_retval.c \ sparc_corenote.c sparc64_corenote.c sparc_auxv.c diff --git a/backends/aarch64_regs.c b/backends/aarch64_regs.c index aec201f3..bd10c464 100644 --- a/backends/aarch64_regs.c +++ b/backends/aarch64_regs.c @@ -1,5 +1,5 @@ /* Register names and numbers for AArch64 DWARF. - Copyright (C) 2013 Red Hat, Inc. + Copyright (C) 2013, 2014 Red Hat, Inc. This file is part of elfutils. This file is free software; you can redistribute it and/or modify @@ -47,32 +47,48 @@ aarch64_register_info (Ebl *ebl __attribute__ ((unused)), return 128; ssize_t - regtype (const char *setname, int type, const char *fmt, int arg) + regtype (const char *setname, int type, const char *rname, bool nr, int arg) { *setnamep = setname; *typep = type; - int s = snprintf (name, namelen, fmt, arg); + int s; + if (nr) + s = snprintf (name, namelen, "%s%d", rname, arg); + else + s = snprintf (name, namelen, "%s", rname); if (s < 0 || (unsigned) s >= namelen) return -1; return s + 1; } + ssize_t + regtyper (const char *setname, int type, const char *rname) + { + return regtype (setname, type, rname, false, 0); + } + + ssize_t + regtypen (const char *setname, int type, const char *rname, int arg) + { + return regtype (setname, type, rname, true, arg); + } + *prefix = ""; *bits = 64; switch (regno) { case 0 ... 30: - return regtype ("integer", DW_ATE_signed, "x%d", regno); + return regtypen ("integer", DW_ATE_signed, "x", regno); case 31: - return regtype ("integer", DW_ATE_address, "sp", 0); + return regtyper ("integer", DW_ATE_address, "sp"); case 32: return 0; case 33: - return regtype ("integer", DW_ATE_address, "elr", 0); + return regtyper ("integer", DW_ATE_address, "elr"); case 34 ... 63: return 0; @@ -84,7 +100,7 @@ aarch64_register_info (Ebl *ebl __attribute__ ((unused)), integers. 128-bit quad-word is the only singular value that covers the whole register, so mark the register thus. */ *bits = 128; - return regtype ("FP/SIMD", DW_ATE_unsigned, "v%d", regno - 64); + return regtypen ("FP/SIMD", DW_ATE_unsigned, "v", regno - 64); case 96 ... 127: return 0; |