summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2017-07-20 13:52:06 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2017-07-24 17:23:53 -0400
commitdb2ef60f362d4414a4397e3a1e9a195f8670773a (patch)
tree54c28c525b20d3e782c4ec1a28743ff2014290c1
parent19b23471d1320b50197751dba806ca05da310826 (diff)
downloadgcc-db2ef60f362d4414a4397e3a1e9a195f8670773a.tar.gz
FIXME: C WIP: inform_about_return_type
-rw-r--r--gcc/c/c-typeck.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 73622461ea7..11841a104b9 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -6160,6 +6160,18 @@ inform_for_arg (tree fundecl, location_t ploc, int parmnum,
expected_type, actual_type);
}
+/* FIXME. */
+
+static void
+inform_about_return_type ()
+{
+ blt_node *bltnode = blt_get_node_for_tree (current_function_decl);
+ if (!bltnode)
+ return;
+ debug (bltnode);
+ inform (UNKNOWN_LOCATION, "would highlight return type here");
+}
+
/* Convert value RHS to type TYPE as preparation for an assignment to
an lvalue of type TYPE. If ORIGTYPE is not NULL_TREE, it is the
original type of RHS; this differs from TREE_TYPE (RHS) for enum
@@ -6240,7 +6252,8 @@ convert_for_assignment (location_t location, location_t expr_loc, tree type,
pedwarn_init (LOCATION, OPT, IN); \
break; \
case ic_return: \
- pedwarn (LOCATION, OPT, RE); \
+ if (pedwarn (LOCATION, OPT, RE)) \
+ inform_about_return_type (); \
break; \
default: \
gcc_unreachable (); \
@@ -6266,7 +6279,8 @@ convert_for_assignment (location_t location, location_t expr_loc, tree type,
pedwarn (LOCATION, OPT, IN, QUALS); \
break; \
case ic_return: \
- pedwarn (LOCATION, OPT, RE, QUALS); \
+ if (pedwarn (LOCATION, OPT, RE, QUALS)) \
+ inform_about_return_type (); \
break; \
default: \
gcc_unreachable (); \
@@ -6292,7 +6306,8 @@ convert_for_assignment (location_t location, location_t expr_loc, tree type,
warning_at (LOCATION, OPT, IN, QUALS); \
break; \
case ic_return: \
- warning_at (LOCATION, OPT, RE, QUALS); \
+ if (warning_at (LOCATION, OPT, RE, QUALS)) \
+ inform_about_return_type (); \
break; \
default: \
gcc_unreachable (); \