From f397a3433d6e15211820b9305815445bb6db4ea8 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin (Intel)" Date: Tue, 30 Jun 2020 10:36:46 -0700 Subject: Make empty db statement a suppressable warning Add a "db-empty" warning class to allow suppressing warnings. Signed-off-by: H. Peter Anvin (Intel) --- 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; } -- cgit v1.2.1