+ if( ! got_type)
+ goto type_check_error;
+
+ if(fa->atype->pointer == NULL ||
+ (strcmp(fa->atype->pointer, "*") != 0 &&
+ strcmp(fa->atype->pointer, "* const") != 0 &&
+ strcmp(fa->atype->pointer, "const *") != 0))
+ goto type_check_error;
+ }
+ }
+ return;
+
+type_check_error:
+ if(fa->atype->pointer)
+ error_printf(GOB_ERROR, m->line_no,
+ "Cannot check the type of '%s %s'",
+ fa->atype->name, fa->atype->pointer);
+ else
+ error_printf(GOB_ERROR, m->line_no,
+ "Cannot check the type of '%s'",
+ fa->atype->name);
+}
+
+static void
+check_func_arg_check_method(Method *m)
+{
+ GList *li;
+ for(li = m->args; li; li = li->next) {
+ FuncArg *fa = li->data;
+ check_func_arg_check_func_arg(m, fa);
+ }
+}
+
+void
+check_func_arg_checks(Class *c)
+{
+ GList *li;
+ for(li = c->nodes; li != NULL; li = li->next) {
+ Node *n = li->data;
+ if(n->type == METHOD_NODE) {
+ Method *m = (Method *)n;
+ check_func_arg_check_method(m);
+ }
+ }
+}
+
+void
+check_func_attrs(Class *c)
+{
+ GList *li;
+ for (li = c->nodes; li != NULL; li = li->next) {
+ Node *n = li->data;
+ if (n->type == METHOD_NODE) {
+ Method *m = (Method *)n;
+ if ((m->method == INIT_METHOD ||
+ m->method == CLASS_INIT_METHOD)
+ && (m->funcattrs != NULL && strlen(m->funcattrs) != 0)) {
+ /* This is actually dead code at the moment, since the parser
+ doesn't accept attributes to the init or class_init
+ syntactic forms anyway. But it could easily be made to do
+ so, and also for virtual override and signal methods, and
+ then we could give kinder error messages here. */
+ error_print (GOB_ERROR, m->line_no,
+ "function attributes (G_GNUC_PRINTF, etc.) aren't "
+ "supported for the init or class_init methods");
+ }
+ }
+ }
+}
+
+void
+check_for_class_destructors (Class *c)
+{
+ GList *li;
+ for (li = c->nodes; li != NULL; li = li->next) {
+ Node *n = li->data;
+ if (n->type == VARIABLE_NODE) {
+ Variable *v = (Variable *)n;
+ if (v->destructor != NULL &&
+ v->scope == CLASS_SCOPE) {
+ error_print (GOB_WARN, v->line_no,
+ "classwide members cannot have "
+ "destructors since the classes "
+ "are static and never get "
+ "destroyed anyway");
+ }