Merge commit '7daa26f9ba3ca45813d16ce540564448c13b16fa' into nasm-2.14.xx

Merge in some warning workarounds/possible bugs discovered by a recent
gcc.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2018-06-15 17:25:57 -07:00
commit 14a10935f7
3 changed files with 6 additions and 2 deletions

View file

@ -199,7 +199,7 @@ static void list_address(int64_t offset, const char *brackets,
static void list_output(const struct out_data *data)
{
char q[20];
char q[24];
uint64_t size = data->size;
uint64_t offset = data->offset;
const uint8_t *p = data->data;

View file

@ -436,6 +436,8 @@ insn *parse_line(int pass, char *buffer, insn *result)
bool recover;
int i;
nasm_static_assert(P_none == 0);
restart_parse:
first = true;
result->forw_ref = false;
@ -444,7 +446,6 @@ restart_parse:
stdscan_set(buffer);
i = stdscan(NULL, &tokval);
nasm_static_assert(P_none == 0);
memset(result->prefixes, P_none, sizeof(result->prefixes));
result->times = 1; /* No TIMES either yet */
result->label = NULL; /* Assume no label */

View file

@ -278,6 +278,9 @@ dnl Suppress format warning on Windows targets due to their <inttypes.h>
PA_ADD_CFLAGS([-Wpedantic-ms-format],[-Wno-pedantic-ms-format])
PA_ADD_CFLAGS([-Wc90-c99-compat])
PA_ADD_CFLAGS([-Wlong-long],[-Wno-long-long])
dnl This is needed because we intentionally expect strncpy() to fill
dnl in a zero-padded (not zero-terminated) buffer in several backends
PA_ADD_CFLAGS([-Wstringop-truncation],[-Wno-stringop-truncation])
dnl PA_ADD_CFLAGS([-Wwrite-strings])
PA_ARG_ENABLED([werror],
[compile with -Werror to error out on any warning],