[1/4] gas: improve unrecognized command line option diagnostic
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_binutils_build--master-arm |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 |
success
|
Test passed
|
linaro-tcwg-bot/tcwg_binutils_check--master-arm |
success
|
Test passed
|
Commit Message
Printing optc with %c makes sense only when optc is actually a
character. Add logic to also deal with unrecognized long options,
rejected by md_parse_option() rather than get_opt_long_only(). Also
quote the reproduced strings, such that possible included whitespace
can be recognized.
@@ -666,8 +666,12 @@ parse_args (int * pargc, char *** pargv)
verbose = 1;
break;
}
+ else if (is_a_char (optc))
+ as_bad (_("unrecognized option `-%c%s'"), optc, optarg ? optarg : "");
+ else if (optarg)
+ as_bad (_("unrecognized option `--%s=%s'"), longopts[longind].name, optarg);
else
- as_bad (_("unrecognized option -%c%s"), optc, optarg ? optarg : "");
+ as_bad (_("unrecognized option `--%s'"), longopts[longind].name);
/* Fall through. */
case '?':
@@ -1,3 +1,3 @@
Assembler messages:
[^:]*: extension does not apply to the base architecture
-[^:]*: unrecognized option -march=armv2\+mp
+[^:]*: unrecognized option .*-march=armv2\+mp.*
@@ -1,3 +1,3 @@
Assembler messages:
[^:]*: extension does not apply to the base architecture
-[^:]*: unrecognized option -march=armv8.1-a\+dotprod
+[^:]*: unrecognized option .*-march=armv8\.1-a\+dotprod.*
@@ -1,3 +1,3 @@
Assembler messages:
[^:]*: extension does not apply to the base architecture
-[^:]*: unrecognized option -march=armv7\+idiv
+[^:]*: unrecognized option .*-march=armv7\+idiv.*