[nasm:master] error: get rid of ERR_PASS1

nasm-bot for H. Peter Anvin (Intel) hpa at zytor.com
Fri Jul 10 01:15:07 PDT 2020


Commit-ID:  72a555972f622a1f1734b7313deb5c002e228595
Gitweb:     http://repo.or.cz/w/nasm.git?a=commitdiff;h=72a555972f622a1f1734b7313deb5c002e228595
Author:     H. Peter Anvin (Intel) <hpa at zytor.com>
AuthorDate: Fri, 10 Jul 2020 01:10:30 -0700
Committer:  H. Peter Anvin (Intel) <hpa at zytor.com>
CommitDate: Fri, 10 Jul 2020 01:10:30 -0700

error: get rid of ERR_PASS1

ERR_PASS1 only remains in three places:

a. Unterminated %! string, an error
   - Should be signalled no matter which pass it is encountered in
b. Two cases of map file problems in outbin
   - The buffered warning system take care of that issue

Signed-off-by: H. Peter Anvin (Intel) <hpa at zytor.com>


---
 asm/nasm.c      | 3 +--
 asm/preproc.c   | 2 +-
 include/error.h | 1 -
 output/outbin.c | 4 ++--
 4 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/asm/nasm.c b/asm/nasm.c
index 918bce91..78cd120b 100644
--- a/asm/nasm.c
+++ b/asm/nasm.c
@@ -2150,8 +2150,7 @@ static void nasm_issue_error(struct nasm_errtext *et)
             here = where.filename ? " here" : " in an unknown location";
         }
 
-        if (warn_list && true_type < ERR_NONFATAL &&
-            !(pass_first() && (severity & ERR_PASS1))) {
+        if (warn_list && true_type < ERR_NONFATAL) {
             /*
              * Buffer up warnings until we either get an error
              * or we are on the code-generation pass.
diff --git a/asm/preproc.c b/asm/preproc.c
index efa48cea..3dac5aef 100644
--- a/asm/preproc.c
+++ b/asm/preproc.c
@@ -1400,7 +1400,7 @@ static Token *tokenize(const char *line)
                     if (*p)
                         p++;
                     else
-                        nasm_nonfatalf(ERR_PASS1, "unterminated %%! string");
+                        nasm_nonfatal("unterminated %%! string");
                 } else {
                     /* %! without anything else... */
                 }
diff --git a/include/error.h b/include/error.h
index d5dc65da..52f5d1d6 100644
--- a/include/error.h
+++ b/include/error.h
@@ -93,7 +93,6 @@ fatal_func nasm_verror_critical(errflags severity, const char *fmt, va_list ap);
 #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 */
-#define ERR_PASS1		0x00000080	/* message on pass_first */
 #define ERR_PASS2		0x00000100	/* ignore unless on pass_final */
 
 #define ERR_NO_SEVERITY		0x00000200	/* suppress printing severity */
diff --git a/output/outbin.c b/output/outbin.c
index 29659f00..3e09005e 100644
--- a/output/outbin.c
+++ b/output/outbin.c
@@ -1326,13 +1326,13 @@ bin_directive(enum directive directive, char *args)
                 else {          /* Must be a filename. */
                     rf = nasm_open_write(p, NF_TEXT);
                     if (!rf) {
-                        nasm_warn(WARN_OTHER|ERR_PASS1, "unable to open map file `%s'", p);
+                        nasm_warn(WARN_OTHER, "unable to open map file `%s'", p);
                         map_control = 0;
                         return DIRR_OK;
                     }
                 }
             } else
-                nasm_warn(WARN_OTHER|ERR_PASS1, "map file already specified");
+                nasm_warn(WARN_OTHER, "map file already specified");
         }
         if (map_control == 0)
             map_control |= MAP_ORIGIN | MAP_SUMMARY;


More information about the Nasm-commits mailing list