diff --git a/asm/labels.c b/asm/labels.c index 6484624f..84099dea 100644 --- a/asm/labels.c +++ b/asm/labels.c @@ -538,7 +538,7 @@ void define_label(const char *label, int32_t segment, * Note: As a special case, LBL_SPECIAL symbols are allowed * to be changed even during the last pass. */ - nasm_warn(WARN_LABEL_REDEF_LATE, + nasm_warn(WARN_LABEL_REDEF_LATE|ERR_UNDEAD, "label `%s' %s during code generation", lptr->defn.label, created ? "defined" : "changed"); } diff --git a/asm/nasm.c b/asm/nasm.c index f967fd6b..644712c4 100644 --- a/asm/nasm.c +++ b/asm/nasm.c @@ -1681,8 +1681,13 @@ static bool skip_this_pass(errflags severity) */ static bool is_suppressed(errflags severity) { + /* Fatal errors must never be suppressed */ if ((severity & ERR_MASK) >= ERR_FATAL) - return false; /* Fatal errors can never be suppressed */ + return false; + + /* This error/warning is pointless if we are dead anyway */ + if ((severity & ERR_UNDEAD) && terminate_after_phase) + return true; return !(warning_state[warn_index(severity)] & WARN_ST_ENABLED); } diff --git a/doc/changes.src b/doc/changes.src index c9b5995a..a4df0473 100644 --- a/doc/changes.src +++ b/doc/changes.src @@ -7,6 +7,11 @@ The NASM 2 series supports x86-64, and is the production version of NASM since 2007. +\S{cl-2.14.03} Version 2.14.03 + +\b Suppress nuisance "\c{label changed during code generation}" messages +after a real error. + \S{cl-2.14.02} Version 2.14.02 \b Fix crash due to multiple errors or warnings during the code diff --git a/include/error.h b/include/error.h index 03a220ec..03380764 100644 --- a/include/error.h +++ b/include/error.h @@ -90,6 +90,7 @@ static inline vefunc nasm_set_verror(vefunc ve) #define ERR_PANIC 0x00000007 /* internal error: panic instantly * and dump core for reference */ #define ERR_MASK 0x00000007 /* mask off the above codes */ +#define ERR_UNDEAD 0x00000008 /* skip if we already have errors */ #define ERR_NOFILE 0x00000010 /* don't give source file name/line */ #define ERR_HERE 0x00000020 /* point to a specific source location */ #define ERR_USAGE 0x00000040 /* print a usage message */