From 5a6312e8c015d4a98020038f3b6e144db230f3ca Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 23 Apr 2018 09:42:44 +0930 Subject: Silence gcc-8 warnings All of these warnings were false positives. -Wstringop-truncation is particularly annoying when it warns about strncpy used quite correctly. bfd/ * elf-linux-core.h (swap_linux_prpsinfo32_ugid32_out): Disable gcc-8 string truncation warning. (swap_linux_prpsinfo32_ugid16_out): Likewise. (swap_linux_prpsinfo64_ugid32_out): Likewise. (swap_linux_prpsinfo64_ugid16_out): Likewise. * elf.c (elfcore_write_prpsinfo): Likewise. gas/ * stabs.c (generate_asm_file): Use memcpy rather than strncpy. Remove call to strlen inside loop. * config/tc-cr16.c (getreg_image): Warning fix. * config/tc-crx.c (getreg_image): Warning fix. --- gas/config/tc-crx.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gas/config/tc-crx.c') diff --git a/gas/config/tc-crx.c b/gas/config/tc-crx.c index ce8cbce..8cf4af4 100644 --- a/gas/config/tc-crx.c +++ b/gas/config/tc-crx.c @@ -1135,8 +1135,7 @@ getreg_image (reg r) /* Issue a error message when register is illegal. */ #define IMAGE_ERR \ as_bad (_("Illegal register (`%s') in instruction: `%s'"), \ - reg_name, ins_parse); \ - break; + reg_name, ins_parse); switch (rreg->type) { @@ -1145,18 +1144,21 @@ getreg_image (reg r) return rreg->image; else IMAGE_ERR; + break; case CRX_CFG_REGTYPE: if (is_procreg) return rreg->image; else IMAGE_ERR; + break; case CRX_R_REGTYPE: if (! is_procreg) return rreg->image; else IMAGE_ERR; + break; case CRX_C_REGTYPE: case CRX_CS_REGTYPE: @@ -1165,6 +1167,7 @@ getreg_image (reg r) default: IMAGE_ERR; + break; } return 0; -- cgit v1.1