Skip to content

Commit 33ef636

Browse files
author
H. Peter Anvin
committed
doc: improve some formatting, mostly of the warning list
Fix some formatting markups, especially with regards to warnings. Signed-off-by: H. Peter Anvin <[email protected]>
1 parent 5f0fb56 commit 33ef636

File tree

7 files changed

+40
-36
lines changed

7 files changed

+40
-36
lines changed

asm/assemble.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ static void debug_macro_out(const struct out_data *data)
342342
* This warning is currently issued by backends, but in the future
343343
* this code should be centralized.
344344
*
345-
*!zeroing [on] RESx in initialized section becomes zero
346-
*! a \c{RESx} directive was used in a section which contains
345+
*!zeroing [on] \c{RES}\e{x} in initialized section becomes zero
346+
*! a \c{RES}\e{x} directive was used in a section which contains
347347
*! initialized data, and the output format does not support
348348
*! this. Instead, this will be replaced with explicit zero
349349
*! content, which may produce a large output file.
@@ -698,7 +698,7 @@ static bool jmp_match(int32_t segment, int64_t offset, int bits,
698698
/* jmp short (opcode eb) cannot be used with bnd prefix. */
699699
ins->prefixes[PPS_REP] = P_none;
700700
/*!
701-
*!prefix-bnd [on] invalid BND prefix
701+
*!prefix-bnd [on] invalid \c{BND} prefix
702702
*!=bnd
703703
*! warns about ineffective use of the \c{BND} prefix when the
704704
*! \c{JMP} instruction is converted to the \c{SHORT} form.
@@ -1847,14 +1847,14 @@ static int64_t calcsize(int32_t segment, int64_t offset, int bits,
18471847
if ((!itemp_has(temp,IF_LOCK) || !is_class(MEMORY, ins->oprs[0].type)) &&
18481848
(!itemp_has(temp,IF_LOCK1) || !is_class(MEMORY, ins->oprs[1].type))) {
18491849
/*!
1850-
*!prefix-lock-error [on] LOCK prefix on unlockable instruction
1850+
*!prefix-lock-error [on] \c{LOCK} prefix on unlockable instruction
18511851
*!=lock
18521852
*! warns about \c{LOCK} prefixes on unlockable instructions.
18531853
*/
18541854
nasm_warn(WARN_PREFIX_LOCK_ERROR|ERR_PASS2 , "instruction is not lockable");
18551855
} else if (temp->opcode == I_XCHG) {
18561856
/*!
1857-
*!prefix-lock-xchg [on] superfluous LOCK prefix on XCHG instruction
1857+
*!prefix-lock-xchg [on] superfluous \c{LOCK} prefix on \c{XCHG} instruction
18581858
*! warns about a \c{LOCK} prefix added to an \c{XCHG} instruction.
18591859
*! The \c{XCHG} instruction is \e{always} locking, and so this
18601860
*! prefix is not necessary; however, NASM will generate it if

asm/error.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ void pop_warnings(void)
132132
if (!ws->next) {
133133
/*!
134134
*!warn-stack-empty [on] warning stack empty
135-
*! a [WARNING POP] directive was executed when
135+
*! a \c{[WARNING POP]} directive was executed when
136136
*! the warning stack is empty. This is treated
137-
*! as a [WARNING *all] directive.
137+
*! as a \c{[WARNING *all]} directive.
138138
*/
139139
nasm_warn(WARN_WARN_STACK_EMPTY, "warning stack empty");
140140
} else {
@@ -280,7 +280,7 @@ bool set_warning_status(const char *value)
280280

281281
if (!ok && value) {
282282
/*!
283-
*!unknown-warning [off] unknown warning in -W/-w or warning directive
283+
*!unknown-warning [off] unknown warning in \c{-W}/\c{-w} or warning directive
284284
*! warns about a \c{-w} or \c{-W} option or a \c{[WARNING]} directive
285285
*! that contains an unknown warning name or is otherwise not possible to process.
286286
*/

asm/parser.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ insn *parse_line(char *buffer, insn *result)
671671
i = stdscan(NULL, &tokval);
672672
} else if (i == 0) {
673673
/*!
674-
*!label-orphan [on] labels alone on lines without trailing `:'
674+
*!label-orphan [on] labels alone on lines without trailing \c{:}
675675
*!=orphan-labels
676676
*! warns about source lines which contain no instruction but define
677677
*! a label without a trailing colon. This is most likely indicative
@@ -831,7 +831,7 @@ insn *parse_line(char *buffer, insn *result)
831831
if (oper_num == 0)
832832
/*!
833833
*!db-empty [on] no operand for data declaration
834-
*! warns about a \c{DB}, \c{DW}, etc declaration
834+
*! warns about a \c{D}\e{x} declaration
835835
*! with no operands, producing no output.
836836
*! This is permitted, but often indicative of an error.
837837
*! See \k{db}.

asm/pragma.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ search_pragma_list(const struct pragma_facility *list,
193193
switch (pragma.opcode) {
194194
case D_none:
195195
/*!
196-
*!pragma-bad [off] malformed %pragma
196+
*!pragma-bad [off] malformed \c{%pragma}
197197
*!=bad-pragma
198198
*! warns about a malformed or otherwise unparsable
199199
*! \c{%pragma} directive.
@@ -203,7 +203,7 @@ search_pragma_list(const struct pragma_facility *list,
203203
break;
204204
default:
205205
/*!
206-
*!pragma-unknown [off] unknown %pragma facility or directive
206+
*!pragma-unknown [off] unknown \c{%pragma} facility or directive
207207
*!=unknown-pragma
208208
*! warns about an unknown \c{%pragma} directive.
209209
*! This is not yet implemented for most cases.
@@ -237,15 +237,15 @@ search_pragma_list(const struct pragma_facility *list,
237237

238238
/* This warning message is intended for future use */
239239
/*!
240-
*!pragma-na [off] %pragma not applicable to this compilation
240+
*!pragma-na [off] \c{%pragma} not applicable to this compilation
241241
*!=not-my-pragma
242242
*! warns about a \c{%pragma} directive which is not applicable to
243243
*! this particular assembly session. This is not yet implemented.
244244
*/
245245

246246
/* Naked %pragma */
247247
/*!
248-
*!pragma-empty [off] empty %pragma directive
248+
*!pragma-empty [off] empty \c{%pragma} directive
249249
*! warns about a \c{%pragma} directive containing nothing.
250250
*! This is treated identically to \c{%pragma ignore} except
251251
*! for this optional warning.

asm/preproc.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,12 +1379,12 @@ static Token *tokenize(const char *line)
13791379
*/
13801380
if (!*p) {
13811381
/*!
1382-
*!pp-open-brackets [on] unterminated %[...]
1382+
*!pp-open-brackets [on] unterminated \c{%[...]}
13831383
*! warns that a preprocessor \c{%[...]} construct
13841384
*! lacks the terminating \c{]} character.
13851385
*/
13861386
/*!
1387-
*!pp-open-braces [on] unterminated %{...}
1387+
*!pp-open-braces [on] unterminated \c{%\{...\}}
13881388
*! warns that a preprocessor parameter
13891389
*! enclosed in braces \c{%\{...\}} lacks the
13901390
*! terminating \c{\}} character.
@@ -1449,7 +1449,7 @@ static Token *tokenize(const char *line)
14491449
type = '%'; /* % operator */
14501450
if (unlikely(*line == '{')) {
14511451
/*!
1452-
*!pp-empty-braces [on] empty %{} construct
1452+
*!pp-empty-braces [on] empty \c{%\{\}} construct
14531453
*! warns that an empty \c{%\{\}} was encountered.
14541454
*! This expands to a single \c{%} character, which
14551455
*! is normally the \c{%} arithmetic operator.
@@ -4432,7 +4432,7 @@ static int do_directive(Token *tline, Token **output)
44324432
goto issue_error;
44334433
case PP_WARNING:
44344434
/*!
4435-
*!user [on] %warning directives
4435+
*!user [on] \c{%warning} directives
44364436
*! controls output of \c{%warning} directives (see \k{pperror}).
44374437
*/
44384438
severity = ERR_WARNING|WARN_USER|ERR_PASS2;
@@ -4491,10 +4491,10 @@ static int do_directive(Token *tline, Token **output)
44914491
case COND_ELSE_TRUE:
44924492
case COND_ELSE_FALSE:
44934493
/*!
4494-
*!pp-else-elif [on] %elif after %else
4495-
*! warns that an \c{%%elif}-type directive was encountered
4496-
*! after \c[%%else} has already been encounted. As a result, the
4497-
*! content of the \c{%%elif} will never be expanded.
4494+
*!pp-else-elif [on] \c{%elif} after \c{%else}
4495+
*! warns that an \c{%elif}-type directive was encountered
4496+
*! after \c{%else} has already been encounted. As a result, the
4497+
*! content of the \c{%elif} will never be expanded.
44984498
*/
44994499
nasm_warn(WARN_PP_ELSE_ELIF|ERR_PP_PRECOND,
45004500
"`%s' after `%%else', ignoring content", dname);
@@ -4541,7 +4541,7 @@ static int do_directive(Token *tline, Token **output)
45414541
case COND_ELSE_TRUE:
45424542
case COND_ELSE_FALSE:
45434543
/*!
4544-
*!pp-else-else [on] %else after %else
4544+
*!pp-else-else [on] \c{%else} after \c{%else}
45454545
*! warns that a second \c{%else} clause was found for
45464546
*! the same \c{%if} statement. The content of this \c{%else}
45474547
*! clause will never be expanded.
@@ -4785,7 +4785,7 @@ static int do_directive(Token *tline, Token **output)
47854785
count = 0;
47864786
} else if (count < 0) {
47874787
/*!
4788-
*!pp-rep-negative [on] regative %rep count
4788+
*!pp-rep-negative [on] regative \c{%rep} count
47894789
*!=negative-rep
47904790
*! warns about a negative count given to the \c{%rep}
47914791
*! preprocessor directive.
@@ -7303,8 +7303,8 @@ stdmac_cond_sel(const SMacro *s, Token **params, int nparams)
73037303
}
73047304
} else {
73057305
/*!
7306-
*!pp-sel-range [on] %sel() argument out of range
7307-
*! warns that the %sel() preprocessor function was passed
7306+
*!pp-sel-range [on] \c{%sel()} argument out of range
7307+
*! warns that the \c{%sel()} preprocessor function was passed
73087308
*! a value less than 1 or larger than the number of available
73097309
*! arguments.
73107310
*/

asm/stdscan.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,14 @@ static int stdscan_token(struct tokenval *tv)
174174

175175
token_type = nasm_token_hash(tv->t_charptr, tv);
176176
if (unlikely(tv->t_flag & TFLAG_WARN)) {
177-
/*!
178-
*!ptr [on] non-NASM keyword used in other assemblers
179-
*! warns about keywords used in other assemblers that might
180-
*! indicate a mistake in the source code. Currently only the MASM
181-
*! \c{PTR} keyword is recognized. See also \k{pkg_masm}.
177+
/*! ptr [on] non-NASM keyword used in other assemblers
178+
*! warns about keywords used in other assemblers that
179+
*! might indicate a mistake in the source code.
180+
*! Currently only the MASM \c{PTR} keyword is
181+
*! recognized. If (limited) MASM compatibility is
182+
*! desired, the \c{%use masm} macro package is
183+
*! available, see \k{pkg_masm}; however, carefully note
184+
*! the caveats listed.
182185
*/
183186
nasm_warn(WARN_PTR, "`%s' is not a NASM keyword",
184187
tv->t_charptr);

doc/nasmdoc.src

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,14 +1264,15 @@ uninitialized}\i{uninitialized} counterparts \i\c{RESB}, \i\c{RESW},
12641264
\i\c\{RESZ}; the \i\c{INCBIN} command, the \i\c{EQU} command, and the
12651265
\i\c{TIMES} prefix.
12661266

1267-
In this documentation, the notation "\c{Dx}" and "\c{RESx}" is used to
1268-
indicate all the \c{DB} and \c{RESB} type directives, respectively.
1267+
In this documentation, the notation "\c{D}\e{x}" and "\c{RES}\e{x}" is
1268+
used to indicate all the \c{DB} and \c{RESB} type directives,
1269+
respectively.
12691270

12701271

1271-
\S{db} \c{Dx}: Declaring Initialized Data
1272+
\S{db} \c{D}\e{x}: Declaring Initialized Data
12721273

12731274
\i\c{DB}, \i\c{DW}, \i\c{DD}, \i\c{DQ}, \i\c{DT}, \i\c{DO}, \i\c{DY}
1274-
and \i\c{DZ} (collectively "\c{Dx}" in this documentation) are used,
1275+
and \i\c{DZ} (collectively "\c{D}\e{x}" in this documentation) are used,
12751276
much as in MASM, to declare initialized data in the output file. They
12761277
can be invoked in a wide range of ways:
12771278
\I{floating-point}\I{character constant}\I{string constant}
@@ -1337,7 +1338,7 @@ valid:
13371338
\c dd 16 dup (0xaaaa, ?, 0xbbbbbb)
13381339
\c dd 64 dup (?)
13391340

1340-
\I{baddb} The use of \c{$} (current address) in a \c{Dx} statement is
1341+
\I{baddb} The use of \c{$} (current address) in a \c{D}\e{x} statement is
13411342
undefined in the current version of NASM, \e{except in the following
13421343
cases}:
13431344

0 commit comments

Comments
 (0)