1
0
mirror of https://github.com/pfusik/xasm.git synced 2024-06-03 00:29:36 +00:00

"opt u-" disables "/u" unused label warnings.

This commit is contained in:
Piotr Fusik 2014-04-30 09:19:49 +02:00
parent 167c441fed
commit 61327c8e5b
2 changed files with 9 additions and 2 deletions

View File

@ -275,10 +275,11 @@ Five options are available:
- `H` - generate Atari executable headers - `H` - generate Atari executable headers
- `L` - write to the listing - `L` - write to the listing
- `O` - write to the object file - `O` - write to the object file
- `U` - warn of unused labels
+ +
You can turn any of these on or off. You can turn any of these on or off.
The default (if no `OPT` specified) is `opt f-g-h+l+o+`. The default (if no `OPT` specified) is `opt f-g-h+l+o+u+`.
Examples: Examples:
+ +
------------------------------------------------------------------------------ ------------------------------------------------------------------------------

8
xasm.d
View File

@ -48,6 +48,7 @@ bool option5200; // opt g
bool optionHeaders; // opt h bool optionHeaders; // opt h
bool optionListing; // opt l bool optionListing; // opt l
bool optionObject; // opt o bool optionObject; // opt o
bool optionUnusedLabels; // opt u
string currentFilename; string currentFilename;
int lineNo; int lineNo;
@ -2155,6 +2156,10 @@ void assemblyOpt() {
case 'o': case 'o':
optionObject = readOption(); optionObject = readOption();
break; break;
case 'U':
case 'u':
optionUnusedLabels = readOption();
break;
default: default:
column--; column--;
return; return;
@ -2687,7 +2692,7 @@ void assemblyLine() {
assert(label in labelTable); assert(label in labelTable);
currentLabel = labelTable[label]; currentLabel = labelTable[label];
currentLabel.passed = true; currentLabel.passed = true;
if (currentLabel.unused && getOption('u')) if (currentLabel.unused && getOption('u') && optionUnusedLabels)
warning("Unused label"); warning("Unused label");
} }
} }
@ -2827,6 +2832,7 @@ void assemblyPass() {
optionHeaders = true; optionHeaders = true;
optionListing = pass2; optionListing = pass2;
optionObject = true; optionObject = true;
optionUnusedLabels = true;
willSkip = false; willSkip = false;
skipping = false; skipping = false;
repeatOffset = 0; repeatOffset = 0;