From 51af4082cc898b122b88f11fd34033fc00fad81e Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 6 Nov 2015 20:15:04 -0800 Subject: [PATCH] Added -Wno-segreg-in-64bit. This allows suppressing the annoying 'segment register ignored in 64-bit mode' warning. --- frontends/tasm/tasm.c | 2 ++ frontends/vsyasm/vsyasm.c | 2 ++ frontends/yasm/yasm.c | 2 ++ libyasm/errwarn.h | 3 ++- modules/arch/x86/x86regtmod.gperf | 2 +- 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/frontends/tasm/tasm.c b/frontends/tasm/tasm.c index 8019ff75..93c11c98 100644 --- a/frontends/tasm/tasm.c +++ b/frontends/tasm/tasm.c @@ -791,6 +791,8 @@ opt_warning_handler(char *cmd, /*@unused@*/ char *param, int extra) action(YASM_WARN_UNINIT_CONTENTS); else if (strcmp(cmd, "size-override") == 0) action(YASM_WARN_SIZE_OVERRIDE); + else if (strcmp(cmd, "segreg-in-64bit") == 0) + action(YASM_WARN_SEGREG_IN_64BIT); else return 1; diff --git a/frontends/vsyasm/vsyasm.c b/frontends/vsyasm/vsyasm.c index a057b6f7..892b9b33 100644 --- a/frontends/vsyasm/vsyasm.c +++ b/frontends/vsyasm/vsyasm.c @@ -1120,6 +1120,8 @@ opt_warning_handler(char *cmd, /*@unused@*/ char *param, int extra) action(YASM_WARN_UNINIT_CONTENTS); else if (strcmp(cmd, "size-override") == 0) action(YASM_WARN_SIZE_OVERRIDE); + else if (strcmp(cmd, "segreg-in-64bit") == 0) + action(YASM_WARN_SEGREG_IN_64BIT); else return 1; diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index 74c16223..75d96755 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -1094,6 +1094,8 @@ opt_warning_handler(char *cmd, /*@unused@*/ char *param, int extra) action(YASM_WARN_UNINIT_CONTENTS); else if (strcmp(cmd, "size-override") == 0) action(YASM_WARN_SIZE_OVERRIDE); + else if (strcmp(cmd, "segreg-in-64bit") == 0) + action(YASM_WARN_SEGREG_IN_64BIT); else return 1; diff --git a/libyasm/errwarn.h b/libyasm/errwarn.h index ede2f287..25f68226 100644 --- a/libyasm/errwarn.h +++ b/libyasm/errwarn.h @@ -43,7 +43,8 @@ typedef enum yasm_warn_class { YASM_WARN_ORPHAN_LABEL, /**< Label alone on a line without a colon */ YASM_WARN_UNINIT_CONTENTS, /**< Uninitialized space in code/data section */ YASM_WARN_SIZE_OVERRIDE,/**< Double size override */ - YASM_WARN_IMPLICIT_SIZE_OVERRIDE /**< Implicit size override */ + YASM_WARN_IMPLICIT_SIZE_OVERRIDE, /**< Implicit size override */ + YASM_WARN_SEGREG_IN_64BIT /**< Segment register ignored in 64-bit mode */ } yasm_warn_class; /** Error classes. Bitmask-based to support limited subclassing. */ diff --git a/modules/arch/x86/x86regtmod.gperf b/modules/arch/x86/x86regtmod.gperf index 64ee7d9d..38986df0 100644 --- a/modules/arch/x86/x86regtmod.gperf +++ b/modules/arch/x86/x86regtmod.gperf @@ -284,7 +284,7 @@ yasm_x86__parse_check_regtmod(yasm_arch *arch, const char *id, size_t id_len, } if (type == YASM_ARCH_SEGREG && bits != 0 && arch_x86->mode_bits == bits) { - yasm_warn_set(YASM_WARN_GENERAL, + yasm_warn_set(YASM_WARN_SEGREG_IN_64BIT, N_("`%s' segment register ignored in %u-bit mode"), id, bits); } -- 2.49.0