From 42b9579f90d26d2123036cbab9ca8c20226423d3 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin (Intel)" Date: Wed, 27 Jun 2018 22:03:01 -0700 Subject: preproc: add new %note directive Add a new %note directive to issue a note into the list file without printing a message. The difference between %note and a comment is that a %note will be issued with single-line macros expanded, and will be issued even if it occurs inside a .nolist macro. Signed-off-by: H. Peter Anvin (Intel) --- asm/nasm.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'asm/nasm.c') diff --git a/asm/nasm.c b/asm/nasm.c index 55e4a8cf..e1e3eff0 100644 --- a/asm/nasm.c +++ b/asm/nasm.c @@ -1801,6 +1801,12 @@ static bool skip_this_pass(int severity) if ((severity & ERR_MASK) > ERR_NONFATAL) return false; + /* + * We *never* print a message for ERR_NOTE. + */ + if ((severity & ERR_MASK) == ERR_NOTE) + return true; + /* * passn is 1 on the very first pass only. * pass0 is 2 on the code-generation (final) pass only. @@ -1826,6 +1832,12 @@ static void nasm_verror_common(int severity, const char *fmt, va_list args) const char *pfx; switch (severity & (ERR_MASK|ERR_NO_SEVERITY)) { + case ERR_NOTE: + pfx = "note: "; + break; + case ERR_DEBUG: + pfx = "debug: "; + break; case ERR_WARNING: pfx = "warning: "; break; @@ -1838,9 +1850,6 @@ static void nasm_verror_common(int severity, const char *fmt, va_list args) case ERR_PANIC: pfx = "panic: "; break; - case ERR_DEBUG: - pfx = "debug: "; - break; default: pfx = ""; break; @@ -1861,7 +1870,7 @@ static void nasm_verror_common(int severity, const char *fmt, va_list args) /* * Don't suppress this with skip_this_pass(), or we don't get - * pass1 or preprocessor warnings in the list file + * pass1 or preprocessor warnings or notes in the list file */ lfmt->error(severity, pfx, msg); @@ -1874,6 +1883,7 @@ static void nasm_verror_common(int severity, const char *fmt, va_list args) preproc->error_list_macros(severity); switch (severity & ERR_MASK) { + case ERR_NOTE: case ERR_DEBUG: /* no further action, by definition */ break; -- cgit v1.2.1