mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-07 15:01:10 +00:00
introducing -fassign-function-types, previously guarded by std==qcc this is now the flag to cause a warning (-Wassign-function-types) instead of an error when assigning functions of wrong types
This commit is contained in:
parent
b4a5517851
commit
0d3896ca54
3 changed files with 4 additions and 1 deletions
2
main.c
2
main.c
|
@ -202,11 +202,13 @@ static bool options_parse(int argc, char **argv) {
|
||||||
opts_standard = COMPILER_GMQCC;
|
opts_standard = COMPILER_GMQCC;
|
||||||
} else if (!strcmp(argarg, "qcc")) {
|
} else if (!strcmp(argarg, "qcc")) {
|
||||||
options_set(opts_flags, ADJUST_VECTOR_FIELDS, false);
|
options_set(opts_flags, ADJUST_VECTOR_FIELDS, false);
|
||||||
|
options_set(opts_flags, ASSIGN_FUNCTION_TYPES, true);
|
||||||
opts_standard = COMPILER_QCC;
|
opts_standard = COMPILER_QCC;
|
||||||
} else if (!strcmp(argarg, "fte") || !strcmp(argarg, "fteqcc")) {
|
} else if (!strcmp(argarg, "fte") || !strcmp(argarg, "fteqcc")) {
|
||||||
options_set(opts_flags, FTEPP, true);
|
options_set(opts_flags, FTEPP, true);
|
||||||
options_set(opts_flags, TRANSLATABLE_STRINGS, true);
|
options_set(opts_flags, TRANSLATABLE_STRINGS, true);
|
||||||
options_set(opts_flags, ADJUST_VECTOR_FIELDS, false);
|
options_set(opts_flags, ADJUST_VECTOR_FIELDS, false);
|
||||||
|
options_set(opts_flags, ASSIGN_FUNCTION_TYPES, true);
|
||||||
opts_standard = COMPILER_FTEQCC;
|
opts_standard = COMPILER_FTEQCC;
|
||||||
} else if (!strcmp(argarg, "qccx")) {
|
} else if (!strcmp(argarg, "qccx")) {
|
||||||
options_set(opts_flags, ADJUST_VECTOR_FIELDS, false);
|
options_set(opts_flags, ADJUST_VECTOR_FIELDS, false);
|
||||||
|
|
1
opts.def
1
opts.def
|
@ -37,6 +37,7 @@
|
||||||
GMQCC_DEFINE_FLAG(PERL_LOGIC)
|
GMQCC_DEFINE_FLAG(PERL_LOGIC)
|
||||||
GMQCC_DEFINE_FLAG(TRANSLATABLE_STRINGS)
|
GMQCC_DEFINE_FLAG(TRANSLATABLE_STRINGS)
|
||||||
GMQCC_DEFINE_FLAG(INITIALIZED_NONCONSTANTS)
|
GMQCC_DEFINE_FLAG(INITIALIZED_NONCONSTANTS)
|
||||||
|
GMQCC_DEFINE_FLAG(ASSIGN_FUNCTION_TYPES)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* warning flags */
|
/* warning flags */
|
||||||
|
|
2
parser.c
2
parser.c
|
@ -905,7 +905,7 @@ static bool parser_sy_pop(parser_t *parser, shunt *sy)
|
||||||
if (!ast_compare_type(field->expression.next, exprs[1])) {
|
if (!ast_compare_type(field->expression.next, exprs[1])) {
|
||||||
ast_type_to_string(field->expression.next, ty1, sizeof(ty1));
|
ast_type_to_string(field->expression.next, ty1, sizeof(ty1));
|
||||||
ast_type_to_string(exprs[1], ty2, sizeof(ty2));
|
ast_type_to_string(exprs[1], ty2, sizeof(ty2));
|
||||||
if (opts_standard == COMPILER_QCC &&
|
if (OPTS_FLAG(ASSIGN_FUNCTION_TYPES) &&
|
||||||
field->expression.next->expression.vtype == TYPE_FUNCTION &&
|
field->expression.next->expression.vtype == TYPE_FUNCTION &&
|
||||||
exprs[1]->expression.vtype == TYPE_FUNCTION)
|
exprs[1]->expression.vtype == TYPE_FUNCTION)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue