Warn about type qualifiers in the return type of function types.
[cparser] / parser.c
index e5fb27f..119677c 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -4167,6 +4167,10 @@ static type_t *construct_declarator_type(construct_type_t *construct_list,
                                errorf(HERE, "function returning array is not allowed");
                                type = type_error_type;
                        } else {
+                               if (skipped_return_type->base.qualifiers != 0) {
+                                       warningf(HERE,
+                                               "type qualifiers in return type of function type are meaningless");
+                               }
                                type = function_type;
                        }
                        break;