- if (is_type_pointer(expected_type_skip)) {
- if (is_type_pointer(ptr_skip)) {
- type_t *const exp_to = skip_typeref(expected_type_skip->pointer.points_to);
- type_t *const arg_to = skip_typeref(ptr_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(ptr_skip) == expected_type_skip) {
+ /* do NOT allow const or restrict, all other should be ok */
+ if (ptr_skip->base.qualifiers & (TYPE_QUALIFIER_CONST | TYPE_QUALIFIER_VOLATILE))
+ goto error_arg_type;
+ type_t *const unqual_ptr = get_unqualified_type(ptr_skip);
+ if (unqual_ptr == expected_type_skip) {
+ goto next_arg;
+ } else if (expected_type_skip == type_char) {
+ /* char matches with unsigned char AND signed char */
+ if (unqual_ptr == type_signed_char || unqual_ptr == type_unsigned_char)