mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-23 20:33:05 +00:00
Removed -fenhanced-diagnostics - it's now --correct, which makes sense since it doesn't affect the compilation process itself
This commit is contained in:
parent
d1def27dbb
commit
3652a122ed
7 changed files with 16 additions and 8 deletions
|
@ -151,6 +151,10 @@ String containing the compiler version as printed by the --version
|
||||||
parameter.
|
parameter.
|
||||||
.RE
|
.RE
|
||||||
.TP
|
.TP
|
||||||
|
.BR "--correct" ", " "--no-correct"
|
||||||
|
When enabled, errors about undefined values try to suggest an existing
|
||||||
|
value via spell checking.
|
||||||
|
.TP
|
||||||
.B "-dump"
|
.B "-dump"
|
||||||
DEBUG OPTION. Print the code's intermediate representation before the
|
DEBUG OPTION. Print the code's intermediate representation before the
|
||||||
optimization and finalization passes to stdout before generating the
|
optimization and finalization passes to stdout before generating the
|
||||||
|
|
1
gmqcc.h
1
gmqcc.h
|
@ -1149,6 +1149,7 @@ typedef struct {
|
||||||
bool pp_only; /* -E */
|
bool pp_only; /* -E */
|
||||||
size_t max_array_size; /* --max-array= */
|
size_t max_array_size; /* --max-array= */
|
||||||
bool add_info; /* --add-info */
|
bool add_info; /* --add-info */
|
||||||
|
bool correction; /* --correct */
|
||||||
|
|
||||||
uint32_t flags [1 + (COUNT_FLAGS / 32)];
|
uint32_t flags [1 + (COUNT_FLAGS / 32)];
|
||||||
uint32_t warn [1 + (COUNT_WARNINGS / 32)];
|
uint32_t warn [1 + (COUNT_WARNINGS / 32)];
|
||||||
|
|
|
@ -99,10 +99,6 @@
|
||||||
# variables with the name 'nil' to be declared.
|
# variables with the name 'nil' to be declared.
|
||||||
PREMISSIVE = false
|
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)
|
# Allow vararg access from within QC of the form: ...(argnumber, type)
|
||||||
VARIADIC_ARGS = true
|
VARIADIC_ARGS = true
|
||||||
|
|
||||||
|
|
8
main.c
8
main.c
|
@ -465,6 +465,14 @@ static bool options_parse(int argc, char **argv) {
|
||||||
opts.quiet = true;
|
opts.quiet = true;
|
||||||
break;
|
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")) {
|
else if (!strcmp(argv[0]+2, "add-info")) {
|
||||||
opts.add_info = true;
|
opts.add_info = true;
|
||||||
break;
|
break;
|
||||||
|
|
4
opts.c
4
opts.c
|
@ -27,7 +27,8 @@ opts_cmd_t opts; /* command lien options */
|
||||||
|
|
||||||
static void opts_setdefault() {
|
static void opts_setdefault() {
|
||||||
memset(&opts, 0, sizeof(opts_cmd_t));
|
memset(&opts, 0, sizeof(opts_cmd_t));
|
||||||
|
opts.correction = true;
|
||||||
|
|
||||||
/* warnings */
|
/* warnings */
|
||||||
opts_set(opts.warn, WARN_UNUSED_VARIABLE, true);
|
opts_set(opts.warn, WARN_UNUSED_VARIABLE, true);
|
||||||
opts_set(opts.warn, WARN_USED_UNINITIALIZED, true);
|
opts_set(opts.warn, WARN_USED_UNINITIALIZED, true);
|
||||||
|
@ -65,7 +66,6 @@ static void opts_setdefault() {
|
||||||
opts_set(opts.flags, FTEPP_PREDEFS, false);
|
opts_set(opts.flags, FTEPP_PREDEFS, false);
|
||||||
opts_set(opts.flags, CORRECT_TERNARY, true);
|
opts_set(opts.flags, CORRECT_TERNARY, true);
|
||||||
opts_set(opts.flags, BAIL_ON_WERROR, true);
|
opts_set(opts.flags, BAIL_ON_WERROR, true);
|
||||||
opts_set(opts.flags, ENHANCED_DIAGNOSTICS, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void opts_backup_non_Wall() {
|
void opts_backup_non_Wall() {
|
||||||
|
|
1
opts.def
1
opts.def
|
@ -48,7 +48,6 @@
|
||||||
GMQCC_DEFINE_FLAG(LOOP_LABELS)
|
GMQCC_DEFINE_FLAG(LOOP_LABELS)
|
||||||
GMQCC_DEFINE_FLAG(UNTYPED_NIL)
|
GMQCC_DEFINE_FLAG(UNTYPED_NIL)
|
||||||
GMQCC_DEFINE_FLAG(PERMISSIVE)
|
GMQCC_DEFINE_FLAG(PERMISSIVE)
|
||||||
GMQCC_DEFINE_FLAG(ENHANCED_DIAGNOSTICS)
|
|
||||||
GMQCC_DEFINE_FLAG(VARIADIC_ARGS)
|
GMQCC_DEFINE_FLAG(VARIADIC_ARGS)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
2
parser.c
2
parser.c
|
@ -1795,7 +1795,7 @@ static ast_expression* parse_expression_leave(parser_t *parser, bool stopatcomma
|
||||||
* We should also consider adding correction tables for
|
* We should also consider adding correction tables for
|
||||||
* other things as well.
|
* other things as well.
|
||||||
*/
|
*/
|
||||||
if (OPTS_FLAG(ENHANCED_DIAGNOSTICS)) {
|
if (opts.correction) {
|
||||||
correction_t corr;
|
correction_t corr;
|
||||||
correct_init(&corr);
|
correct_init(&corr);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue