mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-31 05:00:35 +00:00
add interface-check warning option. defaults off
This commit is contained in:
parent
d05f17cdae
commit
5e6b25c917
4 changed files with 15 additions and 4 deletions
|
@ -159,6 +159,10 @@ Emit a warning when the source assigns a value to a named constant. See the
|
||||||
description of the \fBcow\fP code option above for a description of what this
|
description of the \fBcow\fP code option above for a description of what this
|
||||||
means.
|
means.
|
||||||
.TP
|
.TP
|
||||||
|
.B interface\-check
|
||||||
|
Emit a warning when a method is declared in an implementation but not in the
|
||||||
|
interface for a class.
|
||||||
|
.TP
|
||||||
.B undef\-function
|
.B undef\-function
|
||||||
Emit a warning when a function is called, but has not yet been defined.
|
Emit a warning when a function is called, but has not yet been defined.
|
||||||
.TP
|
.TP
|
||||||
|
|
|
@ -47,6 +47,7 @@ typedef struct {
|
||||||
qboolean uninited_variable; // Warn on use of uninitialized vars
|
qboolean uninited_variable; // Warn on use of uninitialized vars
|
||||||
qboolean vararg_integer; // Warn on passing an integer to vararg func
|
qboolean vararg_integer; // Warn on passing an integer to vararg func
|
||||||
qboolean integer_divide; // Warn on integer constant division
|
qboolean integer_divide; // Warn on integer constant division
|
||||||
|
qboolean interface_check; // Warn for methods not in interface
|
||||||
} warn_options_t;
|
} warn_options_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -411,10 +411,12 @@ class_find_method (class_type_t *class_type, method_t *method)
|
||||||
}
|
}
|
||||||
sel = dstring_newstr ();
|
sel = dstring_newstr ();
|
||||||
selector_name (sel, (keywordarg_t *)method->selector);
|
selector_name (sel, (keywordarg_t *)method->selector);
|
||||||
warning (0, "%s method %s not in %s%s",
|
if (options.warnings.interface_check) {
|
||||||
method->instance ? "instance" : "class",
|
warning (0, "%s method %s not in %s%s",
|
||||||
sel->str, class_name,
|
method->instance ? "instance" : "class",
|
||||||
category_name ? va (" (%s)", category_name) : "");
|
sel->str, class_name,
|
||||||
|
category_name ? va (" (%s)", category_name) : "");
|
||||||
|
}
|
||||||
dstring_delete (sel);
|
dstring_delete (sel);
|
||||||
return method;
|
return method;
|
||||||
}
|
}
|
||||||
|
|
|
@ -307,6 +307,10 @@ DecodeArgs (int argc, char **argv)
|
||||||
options.warnings.integer_divide = true;
|
options.warnings.integer_divide = true;
|
||||||
} else if (!(strcasecmp (temp, "no-integer-divide"))) {
|
} else if (!(strcasecmp (temp, "no-integer-divide"))) {
|
||||||
options.warnings.integer_divide = false;
|
options.warnings.integer_divide = false;
|
||||||
|
} else if (!(strcasecmp (temp, "interface-check"))) {
|
||||||
|
options.warnings.interface_check = true;
|
||||||
|
} else if (!(strcasecmp (temp, "no-interface-check"))) {
|
||||||
|
options.warnings.interface_check = false;
|
||||||
}
|
}
|
||||||
temp = strtok (NULL, ",");
|
temp = strtok (NULL, ",");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue