diff options
author | H. Peter Anvin (Intel) <hpa@zytor.com> | 2020-06-30 10:36:46 -0700 |
---|---|---|
committer | H. Peter Anvin (Intel) <hpa@zytor.com> | 2020-06-30 10:36:46 -0700 |
commit | f397a3433d6e15211820b9305815445bb6db4ea8 (patch) | |
tree | bbb1650a1dac4219a75ecbc1a6f415f0ae3e7f8d | |
parent | 65ab3ab1976c9e1e2642dd2e79316ff4129d8bc9 (diff) | |
download | nasm-f397a3433d6e15211820b9305815445bb6db4ea8.tar.gz |
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@zytor.com>
-rw-r--r-- | asm/parser.c | 11 |
1 files 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; } |