[nasm:nasm-2.15.xx] Make empty db statement a suppressable warning

nasm-bot for H. Peter Anvin (Intel) hpa at zytor.com
Tue Jun 30 17:03:09 PDT 2020


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

Make empty db statement a suppressable warning

Add a "db-empty" warning class to allow suppressing warnings.

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


---
 asm/parser.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/asm/parser.c b/asm/parser.c
index 3daca0c6..7c24cc00 100644
--- a/asm/parser.c
+++ b/asm/parser.c
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------- *
  *
- *   Copyright 1996-2019 The NASM Authors - All Rights Reserved
+ *   Copyright 1996-2020 The NASM Authors - All Rights Reserved
  *   See the file AUTHORS included with the NASM distribution for
  *   the specific copyright holders.
  *
@@ -831,7 +831,14 @@ restart_parse:
             /* DB et al */
             result->operands = oper_num;
             if (oper_num == 0)
-                nasm_warn(WARN_OTHER, "no operand for data declaration");
+                /*!
+                 *!db-empty [on] no operand for data declaration
+                 *!  warns about a \c{DB}, \c{DW}, etc declaration
+                 *!  with no operands, producing no output.
+                 *!  This is permitted, but often indicative of an error.
+                 *!  See \k{db}.
+                 */
+                nasm_warn(WARN_DB_EMPTY, "no operand for data declaration");
         }
         return result;
     }


More information about the Nasm-commits mailing list