diff options
author | H. Peter Anvin <hpa@zytor.com> | 2018-12-11 00:06:29 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2018-12-11 00:06:29 -0800 |
commit | ddb290681e52aee70fc4b3342829fb9770a089b2 (patch) | |
tree | ac1c8104604e7a11db64198ca8ea1a387a361124 /asm/listing.c | |
parent | 026b62f264b86372cc596e5a035f87385931486a (diff) | |
download | nasm-ddb290681e52aee70fc4b3342829fb9770a089b2.tar.gz |
error: new flag ERR_HERE
ERR_HERE is used to mark messages of the form "... here" so that we
can emit sane output to the list file with filename and line number,
instead of a nonsensical "here" which could point almost anywhere.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'asm/listing.c')
-rw-r--r-- | asm/listing.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/asm/listing.c b/asm/listing.c index b974c46b..5484bd5d 100644 --- a/asm/listing.c +++ b/asm/listing.c @@ -324,12 +324,16 @@ static void list_downlevel(int type) } } -static void list_error(int severity, const char *pfx, const char *msg) +static void list_error(int severity, const char *fmt, ...) { + va_list ap; + if (!listfp) return; - snprintf(listerror, sizeof listerror, "%s%s", pfx, msg); + va_start(ap, fmt); + vsnprintf(listerror, sizeof listerror, fmt, ap); + va_end(ap); if ((severity & ERR_MASK) >= ERR_FATAL) list_emit(); |