aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.h
diff options
context:
space:
mode:
authormorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>2011-04-22 15:15:10 +0000
committermorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>2011-04-22 15:15:10 +0000
commitb9beb682d2ddb4122a669f61237acbe362604612 (patch)
treeb36c67c56e096f326b28f680d72f579114d35764 /epan/proto.h
parentaaec16e376e92df9d6803dfa331a17cc7438b549 (diff)
If we're using GNUC, use attribute warn_unused_result to verify that the
return value of proto_item_add_subtree() is used. (The WARN_IF_UNUSED macro doesn't belong here... But where should it go?) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36812 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/proto.h')
-rw-r--r--epan/proto.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/epan/proto.h b/epan/proto.h
index 4d01bf29b4..1a599d6bc7 100644
--- a/epan/proto.h
+++ b/epan/proto.h
@@ -514,13 +514,18 @@ extern void proto_cleanup(void);
*/
extern gboolean proto_field_is_referenced(proto_tree *tree, int proto_id);
-
+/* XXX where should this go? */
+#ifdef __GNUC__
+#define WARN_IF_UNUSED __attribute__ ((warn_unused_result))
+#else
+#define WARN_IF_UNUSED
+#endif
/** Create a subtree under an existing item.
@param ti the parent item of the new subtree
@param idx one of the ett_ array elements registered with proto_register_subtree_array()
@return the new subtree */
-extern proto_tree* proto_item_add_subtree(proto_item *ti, const gint idx);
+extern proto_tree* proto_item_add_subtree(proto_item *ti, const gint idx) WARN_IF_UNUSED;
/** Get an existing subtree under an item.
@param ti the parent item of the subtree