shithub: rgbds

Download patch

ref: 3cc67c48cf89af221291761611269b37d9b22641
parent: f9a04696f26debc73adac44642bb129bf2f9c70a
author: ISSOtm <[email protected]>
date: Sat Aug 31 13:34:54 EDT 2019

Add recursion limit info to man and help

--- a/src/asm/main.c
+++ b/src/asm/main.c
@@ -288,7 +288,8 @@
 {
 	printf(
 "usage: rgbasm [-EhLVvw] [-b chars] [-Dname[=value]] [-g chars] [-i path]\n"
-"              [-M dependfile] [-o outfile] [-p pad_value] file.asm\n");
+"              [-M dependfile] [-o outfile] [-p pad_value]\n"
+"              [-r recursion_depth] file.asm\n");
 	exit(1);
 }
 
--- a/src/asm/rgbasm.1
+++ b/src/asm/rgbasm.1
@@ -21,6 +21,7 @@
 .Op Fl M Ar dependfile
 .Op Fl o Ar outfile
 .Op Fl p Ar pad_value
+.Op Fl r Ar recursion_depth
 .Ar file
 .Sh DESCRIPTION
 The
@@ -77,6 +78,8 @@
 .It Fl p Ar pad_value
 When padding an image, pad with this value.
 The default is 0x00.
+.It Fl r Ar recursion_depth
+Specifies the recursion depth at which RGBASM will assume being in an infinite loop.
 .It Fl V
 Print the version of the program and exit.
 .It Fl v
--- a/src/asm/rgbasm.5
+++ b/src/asm/rgbasm.5
@@ -455,8 +455,7 @@
 .Sy Important note :
 An EQUS can be expanded to a string that contains another EQUS
 and it will be expanded as well.
-This means that, if you aren't careful, you may trap the assembler into an
-infinite loop if there's a circular dependency in the expansions.
+If this creates an infinite loop, RGBASM will error out once a certain depth is reached. See the -r command-line option.
 Also, a MACRO can have inside an EQUS which references the same MACRO, which has
 the same problem.
 .Pp