summaryrefslogtreecommitdiff
path: root/asm/parser.c
diff options
context:
space:
mode:
authorH. Peter Anvin (Intel) <hpa@zytor.com>2018-12-13 21:53:31 -0800
committerH. Peter Anvin (Intel) <hpa@zytor.com>2018-12-13 21:53:31 -0800
commit723ab481a6550454a6f834bb854e751744ca340a (patch)
treecb217692a76d3dcab83c7ad922e3adca9006dccd /asm/parser.c
parent6bde2ed8806b3e53657d46b61ee79d7afe5c2e13 (diff)
downloadnasm-mkwarnings.tar.gz
warnings: define warning classes at point of usemkwarnings
It is extremely desirable to allow the user fine-grained control of warnings, but this has been complicated by the fact that a warning class has had to be defined in no less than three places (error.h, error.c, nasmdoc.src) before it can be used in source code. Instead, use a script to define these via magic comments at the point of use. This hopefully will encourage creating new classes as needed. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Diffstat (limited to 'asm/parser.c')
-rw-r--r--asm/parser.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/asm/parser.c b/asm/parser.c
index 04def6b4..c34f8337 100644
--- a/asm/parser.c
+++ b/asm/parser.c
@@ -463,6 +463,12 @@ restart_parse:
if (i == ':') { /* skip over the optional colon */
i = stdscan(NULL, &tokval);
} else if (i == 0) {
+ /*!
+ *!orphan-labels [on] labels alone on lines without trailing `:'
+ *! warns about source lines which contain no instruction but define
+ *! a label without a trailing colon. This is most likely indicative
+ *! of a typo, but is technically correct NASM syntax (see \k{syntax}.)
+ */
nasm_warnf(WARN_ORPHAN_LABELS | ERR_PASS1,
"label alone on a line without a colon might be in error");
}