- type_t *const arg_type = arg->expression->base.datatype;
- if (is_type_pointer(expected_type)) {
- type_t *const arg_skip = skip_typeref(arg_type);
- if (is_type_pointer(arg_skip)) {
- type_t *const exp_to = skip_typeref(expected_type->pointer.points_to);
- type_t *const arg_to = skip_typeref(arg_skip->pointer.points_to);
- if (arg_to == exp_to) {
+ { /* create a scope here to prevent warning about the jump to next_arg */
+ type_t *const arg_type = arg->expression->base.type;
+ if (is_type_pointer(expected_type)) {
+ type_t *const arg_skip = skip_typeref(arg_type);
+ if (is_type_pointer(arg_skip)) {
+ type_t *const exp_to = skip_typeref(expected_type->pointer.points_to);
+ type_t *const arg_to = skip_typeref(arg_skip->pointer.points_to);
+ if ((arg_to->base.qualifiers & ~expected_qual) == 0 &&
+ get_unqualified_type(arg_to) == exp_to) {
+ goto next_arg;
+ }
+ }
+ } else {
+ if (get_unqualified_type(skip_typeref(arg_type)) == expected_type) {