From 3cc67c48cf89af221291761611269b37d9b22641 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Sat, 31 Aug 2019 17:34:54 +0200 Subject: [PATCH] Add recursion limit info to man and help --- src/asm/main.c | 3 ++- src/asm/rgbasm.1 | 3 +++ src/asm/rgbasm.5 | 3 +-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/asm/main.c b/src/asm/main.c index a1829347..987e15ce 100644 --- a/src/asm/main.c +++ b/src/asm/main.c @@ -288,7 +288,8 @@ static void print_usage(void) { 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); } diff --git a/src/asm/rgbasm.1 b/src/asm/rgbasm.1 index c81eae3c..027853b7 100644 --- 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 @@ Write an object file to the given filename. .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 diff --git a/src/asm/rgbasm.5 b/src/asm/rgbasm.5 index babe827c..5917d299 100644 --- a/src/asm/rgbasm.5 +++ b/src/asm/rgbasm.5 @@ -455,8 +455,7 @@ String equates can't be exported or imported. .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