Use
.Fl fhelp
to get a list of supported optimizer options.
+.It Fl f Ns Oo Cm no- Oc Ns Cm diagnostics-show-option
+Show the switch, which controls a warning, after each warning.
+Default is on.
.It Fl finput-charset= Ns Ar encoding
Select the encoding of the input.
Supported values are
#include "warning.h"
/** Number of occurred diagnostics. */
-unsigned diagnostic_count = 0;
+unsigned diagnostic_count = 0;
/** Number of occurred errors. */
-unsigned error_count = 0;
+unsigned error_count = 0;
/** Number of occurred warnings. */
-unsigned warning_count = 0;
-bool show_column = true;
+unsigned warning_count = 0;
+bool show_column = true;
+bool diagnostics_show_option = true;
static const source_position_t *curr_pos = NULL;
kind = "warning";
}
diagnosticposvf(pos, kind, fmt, ap);
- fprintf(stderr, " [-W%s]\n", s->name);
+ if (diagnostics_show_option)
+ fprintf(stderr, " [-W%s]\n", s->name);
break;
default:
extern unsigned diagnostic_count;
extern unsigned error_count;
extern unsigned warning_count;
-extern bool show_column; /**< Show column in diagnostic messages */
+extern bool show_column; /**< Show column in diagnostic messages */
+extern bool diagnostics_show_option; /**< Show the switch, which controls a warning. */
#endif
static void print_help_warnings(void)
{
- put_help("-w", "disable all warnings");
- put_help("-Wno-trigraphs", "warn if input contains trigraphs");
- put_help("-Wundef", "Warn if an undefined macro is used in an #if");
+ put_help("-f[no-]diagnostics-show-option", "Show the switch, which controls a warning, after each warning");
+ put_help("-w", "disable all warnings");
+ put_help("-Wno-trigraphs", "warn if input contains trigraphs");
+ put_help("-Wundef", "Warn if an undefined macro is used in an #if");
print_warning_opt_help();
}
if (streq(opt, "builtins")) {
use_builtins = truth_value;
+ } else if (streq(opt, "diagnostics-show-option")) {
+ diagnostics_show_option = truth_value;
} else if (streq(opt, "dollars-in-identifiers")) {
allow_dollar_in_symbol = truth_value;
} else if (streq(opt, "omit-frame-pointer")) {