aboutsummaryrefslogtreecommitdiff
path: root/crates/nasm/src
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-04-30 12:21:20 +0200
committerMiquel Sabaté Solà <mssola@mssola.com>2026-04-30 12:42:55 +0200
commita7bf22ce402256c3a056ac278629552ef4978da2 (patch)
tree952b6fd0df8f3a5d2614d67b90b683689352a295 /crates/nasm/src
parent6a9dea943c078876061eda0f6203647b0c5aadd4 (diff)
downloadtools.nes-a7bf22ce402256c3a056ac278629552ef4978da2.tar.gz
tools.nes-a7bf22ce402256c3a056ac278629552ef4978da2.zip
nasm/xa65: add the --allow-unused option
Since the addition of the check() function in commit 6a9dea943c07 ("Add a new 'check' stage in assemble()"), it can be annoying to some users that the check for unused/unreferenced object applies by default. Hence, add a flag so this can be disabled. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'crates/nasm/src')
-rw-r--r--crates/nasm/src/main.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/nasm/src/main.rs b/crates/nasm/src/main.rs
index 6541d9c..b865fa7 100644
--- a/crates/nasm/src/main.rs
+++ b/crates/nasm/src/main.rs
@@ -21,6 +21,7 @@ struct Args {
defines: Vec<(String, u8)>,
asan: bool,
info: bool,
+ allow_unused: bool,
}
// Print the help message and quit.
@@ -29,6 +30,7 @@ fn print_help() {
println!("usage: nasm [OPTIONS] <FILE>\n");
println!("Options:");
println!(" -a, --asan\t\tEnable the Address Sanitizer.");
+ println!(" --allow-unused\t\tAllow unused .proc's or unreferenced objects.");
println!(" -c, --config <FILE>\tLinker configuration to be used, whether an identifier or a file path.");
println!(
" -D <NAME>(=VALUE)\tDefine an 8-bit variable on the global scope ('VALUE' defaults to '1')"
@@ -108,6 +110,7 @@ fn parse_arguments() -> Args {
while let Some(arg) = args.next() {
match arg.as_str() {
"-a" | "--asan" => res.asan = true,
+ "--allow-unused" => res.allow_unused = true,
"-c" | "--config" => match res.config {
Some(_) => die("only specify the '-C/--config' flag once".to_string()),
None => match args.next() {
@@ -330,6 +333,7 @@ fn main() {
args.config.unwrap_or("nrom".to_string()).as_str(),
&args.defines,
&source,
+ args.allow_unused,
args.asan,
);