summaryrefslogtreecommitdiff
path: root/epan
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2011-04-22 15:15:10 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2011-04-22 15:15:10 +0000
commit64e31d0b0d26fb7c8e941c2b03db8117ec823a5e (patch)
treeb36c67c56e096f326b28f680d72f579114d35764 /epan
parent1229678a4677b9f520e836b0d7cb5a6898e8601d (diff)
downloadwireshark-64e31d0b0d26fb7c8e941c2b03db8117ec823a5e.tar.gz
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?) svn path=/trunk/; revision=36812
Diffstat (limited to 'epan')
-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