[Bug driver/77475] unnecessary or misleading context in reporting command line problems
manu at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Sep 4 21:42:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77475
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |easyhack
CC| |manu at gcc dot gnu.org
--- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
This happens when diagnostics use the implicit input_location and that is not
set correctly:
./config/i386/i386.c:4540: error ("wrong arg %s to option %s",
curr_ran
This should use "error_at (UNKNOWN_LOCATION," or if this option can be set from
an attribute or pragma, it should pass down the correct location from the
caller.
Also, values should be quoted (and 'arg' is not English):
error_at (loc, "wrong argument %qs to option %s", curr_range_str,
And:
Index: i386.c
===================================================================
--- i386.c (revision 239969)
+++ i386.c (working copy)
@@ -5480,7 +5480,7 @@
error ("intel CPU can be used only for %stune=%s %s",
prefix, suffix, sw);
else if (i == pta_size)
- error ("bad value (%s) for %sarch=%s %s",
+ error_at (loc, "bad value %qs for %sarch=%s %s",
opts->x_ix86_arch_string, prefix, suffix, sw);
Ideally, it should also use find_closest_string, so we can say:
gcc: error: unrecognized argument 'i685' in option '-march='; did you mean
'i686' ?
See opts-common.c:cmdline_handle_error
Unfortunately, targets tend to play fast and loose with diagnostics...
More information about the Gcc-bugs
mailing list