-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Closed as not planned
Closed as not planned
Copy link
Labels
easy difficultygood first issue candidateCould be a "good first issue" but something is blocking it or it has open questions.Could be a "good first issue" but something is blocking it or it has open questions.
Description
Abstract
The compiler is pretty lax about command-line options whose values it does not use and just ignores many of them. It should report errors instead.
Over time we've started adding checks against this (e.g. #9075, #9364) they they're still very incomplete.
Motivation
Not getting an error when an option is invalid makes it harder for the user to realize that. It's especially problematic with options that seem to make sense together:
--pretty-jsonsounds like it would affect--standard-jsonbut it only works with--combined-json(Make--pretty-jsonwork with Standard JSON output #11583.)--binshould be supported in the assembler mode but currently isn't ([CLI] Do not ignore the output selection in assembler mode #3870).
Specification
- There are several input modes (compiler, linker, assembler, standard JSON) and many options are not valid in one of these modes. The invalid ones should produce an error.
- Take a look at tests for input modes in
CommandLineParser. Basically, all options do not result in a change inCommandLineOptionsin a specific mode should be invalid in that mode.
- Take a look at tests for input modes in
- Options that have equivalents and Standard JSON should be errors when
--standard-jsonis used. For example:- Model checker settings.
- Remappings.
--color/--no-color- Standard JSON output is not colorized and even when it will be (Support coloured messages in standard json #11507), this option should not affect it.--libraries.--error-codes.
- Please also check options whose values are not ignored by
CommandLineParserbut are still not used byCommandLineInterface.
Backwards Compatibility
This does not introduce any backwards-incompatible changes to the language itself but any command-line tools relying on the current behavior of options being ignored will be affected.
Metadata
Metadata
Assignees
Labels
easy difficultygood first issue candidateCould be a "good first issue" but something is blocking it or it has open questions.Could be a "good first issue" but something is blocking it or it has open questions.