parameter.
.RE
.TP
+.BR "--correct" ", " "--no-correct"
+When enabled, errors about undefined values try to suggest an existing
+value via spell checking.
+.TP
.B "-dump"
DEBUG OPTION. Print the code's intermediate representation before the
optimization and finalization passes to stdout before generating the
bool pp_only; /* -E */
size_t max_array_size; /* --max-array= */
bool add_info; /* --add-info */
+ bool correction; /* --correct */
uint32_t flags [1 + (COUNT_FLAGS / 32)];
uint32_t warn [1 + (COUNT_WARNINGS / 32)];
# variables with the name 'nil' to be declared.
PREMISSIVE = false
- # Enable enhanced diagnostic messages. i.e provides a "did you mean"
- # <ident> when you accidently typo. Amongst others
- ENHANCED_DIAGNOSTICS = true
-
# Allow vararg access from within QC of the form: ...(argnumber, type)
VARIADIC_ARGS = true
opts.quiet = true;
break;
}
+ else if (!strcmp(argv[0]+2, "correct")) {
+ opts.correction = true;
+ break;
+ }
+ else if (!strcmp(argv[0]+2, "no-correct")) {
+ opts.correction = false;
+ break;
+ }
else if (!strcmp(argv[0]+2, "add-info")) {
opts.add_info = true;
break;
static void opts_setdefault() {
memset(&opts, 0, sizeof(opts_cmd_t));
-
+ opts.correction = true;
+
/* warnings */
opts_set(opts.warn, WARN_UNUSED_VARIABLE, true);
opts_set(opts.warn, WARN_USED_UNINITIALIZED, true);
opts_set(opts.flags, FTEPP_PREDEFS, false);
opts_set(opts.flags, CORRECT_TERNARY, true);
opts_set(opts.flags, BAIL_ON_WERROR, true);
- opts_set(opts.flags, ENHANCED_DIAGNOSTICS, true);
}
void opts_backup_non_Wall() {
GMQCC_DEFINE_FLAG(LOOP_LABELS)
GMQCC_DEFINE_FLAG(UNTYPED_NIL)
GMQCC_DEFINE_FLAG(PERMISSIVE)
- GMQCC_DEFINE_FLAG(ENHANCED_DIAGNOSTICS)
GMQCC_DEFINE_FLAG(VARIADIC_ARGS)
#endif
* We should also consider adding correction tables for
* other things as well.
*/
- if (OPTS_FLAG(ENHANCED_DIAGNOSTICS)) {
+ if (opts.correction) {
correction_t corr;
correct_init(&corr);