summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin (Intel) <hpa@zytor.com>2020-06-27 22:30:50 -0700
committerH. Peter Anvin (Intel) <hpa@zytor.com>2020-06-27 22:30:50 -0700
commitde8817ddbcb3e3ecc0e81c1d5fdd973064d41563 (patch)
tree569983d373cbef742eb94f9de70dc3944e1e8999
parent444905e48bc2e4e428064b3ad5ec6d6c5d23d2f1 (diff)
downloadnasm-de8817ddbcb3e3ecc0e81c1d5fdd973064d41563.tar.gz
doc: clean up warnings formatting
When a warning documentation message contains more than one paragraph, we have to indent the subsequent paragraphs using \> unless they are a code paragraph (\c). Improve a few warnings doc messages. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
-rw-r--r--asm/preproc.c2
-rw-r--r--asm/stdscan.c2
-rwxr-xr-xasm/warnings.pl13
3 files changed, 14 insertions, 3 deletions
diff --git a/asm/preproc.c b/asm/preproc.c
index 69c87087..a2c57883 100644
--- a/asm/preproc.c
+++ b/asm/preproc.c
@@ -5946,7 +5946,7 @@ static MMacro *is_mmacro(Token * tline, int *nparamp, Token ***paramsp)
*! The legacy behavior is quite strange and highly context-dependent,
*! and can be disabled with:
*!-
- *! \c %pragma preproc sane_empty_expansion true
+ *! \c %pragma preproc sane_empty_expansion true
*!-
*! It is highly recommended to use this option in new code.
*/
diff --git a/asm/stdscan.c b/asm/stdscan.c
index c1c38f42..cbc0fc77 100644
--- a/asm/stdscan.c
+++ b/asm/stdscan.c
@@ -164,7 +164,7 @@ int stdscan(void *private_data, struct tokenval *tv)
*!ptr [on] non-NASM keyword used in other assemblers
*! warns about keywords used in other assemblers that might
*! indicate a mistake in the source code. Currently only the MASM
- *! \c{PTR} keyword is recognized.
+ *! \c{PTR} keyword is recognized. See also \k{pkg_masm}.
*/
nasm_warn(WARN_PTR, "`%s' is not a NASM keyword",
tv->t_charptr);
diff --git a/asm/warnings.pl b/asm/warnings.pl
index a609e132..8a79568a 100755
--- a/asm/warnings.pl
+++ b/asm/warnings.pl
@@ -253,7 +253,18 @@ if ($what eq 'c') {
} else {
my $docdef = $whatdef{$warn->{def}};
- @doc = @{$warn->{doc}};
+ my $newpara = 0;
+ foreach my $l (@{$warn->{doc}}) {
+ if ($l =~ /^\s*$/) {
+ $newpara = 1;
+ } else {
+ if ($newpara && $l !~ /^\\c\s+/) {
+ $l = '\> ' . $l;
+ }
+ $newpara = 0;
+ }
+ push(@doc, $l);
+ }
if (defined($docdef)) {
push(@doc, "\n", "\\> $docdef by default.\n");
}