mirror of
https://github.com/cc65/cc65.git
synced 2025-08-15 21:27:43 +00:00
Fixed -W cmdline option handling.
Reverted part of 3157e4be1e
as it actually introduced a regression.
It doesn't make sense to check for Arg[3] == '\0' _before_ checking Arg[2] != '\0'. This made the Win32 builds fail to correctly parse e.g. cl65 -W unused-var test.c
This commit is contained in:
@@ -1452,27 +1452,16 @@ int main (int argc, char* argv [])
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'W':
|
case 'W':
|
||||||
/* avoid && with'\0' in if clauses */
|
if (Arg[2] == 'a' && Arg[3] == '\0') {
|
||||||
if (Arg[3] == '\0') {
|
|
||||||
switch (Arg[2]) {
|
|
||||||
case 'a':
|
|
||||||
/* -Wa: Pass options to assembler */
|
/* -Wa: Pass options to assembler */
|
||||||
OptAsmArgs (Arg, GetArg (&I, 3));
|
OptAsmArgs (Arg, GetArg (&I, 3));
|
||||||
break;
|
} else if (Arg[2] == 'c' && Arg[3] == '\0') {
|
||||||
case 'c':
|
/* -Wc: Pass options to compiler */
|
||||||
/* -Wc: Pass options to compiler
|
/* Remember -Wc sub arguments in cc65 arg struct */
|
||||||
** Remember -Wc sub arguments in cc65 arg struct
|
|
||||||
*/
|
|
||||||
OptCCArgs (Arg, GetArg (&I, 3));
|
OptCCArgs (Arg, GetArg (&I, 3));
|
||||||
break;
|
} else if (Arg[2] == 'l' && Arg[3] == '\0') {
|
||||||
case 'l':
|
|
||||||
/* -Wl: Pass options to linker */
|
/* -Wl: Pass options to linker */
|
||||||
OptLdArgs (Arg, GetArg (&I, 3));
|
OptLdArgs (Arg, GetArg (&I, 3));
|
||||||
break;
|
|
||||||
default:
|
|
||||||
UnknownOption (Arg);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
/* Anything else: Suppress warnings (compiler) */
|
/* Anything else: Suppress warnings (compiler) */
|
||||||
CmdAddArg2 (&CC65, "-W", GetArg (&I, 2));
|
CmdAddArg2 (&CC65, "-W", GetArg (&I, 2));
|
||||||
|
Reference in New Issue
Block a user