[nasm:nasm-2.15.xx] doc: clean up warnings formatting
nasm-bot for H. Peter Anvin (Intel)
hpa at zytor.com
Sat Jun 27 22:33:04 PDT 2020
Commit-ID: de8817ddbcb3e3ecc0e81c1d5fdd973064d41563
Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=de8817ddbcb3e3ecc0e81c1d5fdd973064d41563
Author: H. Peter Anvin (Intel) <hpa at zytor.com>
AuthorDate: Sat, 27 Jun 2020 22:30:50 -0700
Committer: H. Peter Anvin (Intel) <hpa at zytor.com>
CommitDate: Sat, 27 Jun 2020 22:30:50 -0700
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 at zytor.com>
---
asm/preproc.c | 2 +-
asm/stdscan.c | 2 +-
asm/warnings.pl | 13 ++++++++++++-
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");
}
More information about the Nasm-commits
mailing list