Index: aim.c
===================================================================
--- aim.c	(revision d427f08508a96769e6a7fd429711b6349caf5b57)
+++ aim.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -437,5 +437,5 @@
 
 /* caller must free the return */
-G_GNUC_WARN_UNUSED_RESULT char *owl_aim_normalize_screenname(const char *in)
+CALLER_OWN char *owl_aim_normalize_screenname(const char *in)
 {
   char *out;
Index: cmd.c
===================================================================
--- cmd.c	(revision d427f08508a96769e6a7fd429711b6349caf5b57)
+++ cmd.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -56,5 +56,5 @@
 
 /* caller must free the return */
-G_GNUC_WARN_UNUSED_RESULT char *_owl_cmddict_execute(const owl_cmddict *cd, const owl_context *ctx, const char *const *argv, int argc, const char *buff)
+CALLER_OWN char *_owl_cmddict_execute(const owl_cmddict *cd, const owl_context *ctx, const char *const *argv, int argc, const char *buff)
 {
   char *retval = NULL;
@@ -73,5 +73,5 @@
 
 /* caller must free the return */
-G_GNUC_WARN_UNUSED_RESULT char *owl_cmddict_execute(const owl_cmddict *cd, const owl_context *ctx, const char *cmdbuff)
+CALLER_OWN char *owl_cmddict_execute(const owl_cmddict *cd, const owl_context *ctx, const char *cmdbuff)
 {
   char **argv;
@@ -97,5 +97,5 @@
 
 /* caller must free the return */
-G_GNUC_WARN_UNUSED_RESULT char *owl_cmddict_execute_argv(const owl_cmddict *cd, const owl_context *ctx, const char *const *argv, int argc)
+CALLER_OWN char *owl_cmddict_execute_argv(const owl_cmddict *cd, const owl_context *ctx, const char *const *argv, int argc)
 {
   char *buff;
@@ -154,5 +154,5 @@
 
 /* caller must free the result */
-G_GNUC_WARN_UNUSED_RESULT char *owl_cmd_execute(const owl_cmd *cmd, const owl_cmddict *cd, const owl_context *ctx, int argc, const char *const *argv, const char *cmdbuff)
+CALLER_OWN char *owl_cmd_execute(const owl_cmd *cmd, const owl_cmddict *cd, const owl_context *ctx, int argc, const char *const *argv, const char *cmdbuff)
 {
   static int alias_recurse_depth = 0;
@@ -228,5 +228,5 @@
 
 /* returns a summary line describing this keymap.  the caller must free. */
-G_GNUC_WARN_UNUSED_RESULT char *owl_cmd_describe(const owl_cmd *cmd)
+CALLER_OWN char *owl_cmd_describe(const owl_cmd *cmd)
 {
   if (!cmd || !cmd->name || !cmd->summary) return NULL;
Index: commands.c
===================================================================
--- commands.c	(revision b47045136e3cc870fe10407242759461f1767d62)
+++ commands.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -1373,5 +1373,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_command_smartfilter(int argc, const char *const *argv, const char *buff)
+CALLER_OWN char *owl_command_smartfilter(int argc, const char *const *argv, const char *buff)
 {
   char *filtname = NULL;
@@ -1413,5 +1413,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_command_get_shift(int argc, const char *const *argv, const char *buff)
+CALLER_OWN char *owl_command_get_shift(int argc, const char *const *argv, const char *buff)
 {
   if(argc != 1)
@@ -1644,35 +1644,35 @@
 
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_command_exec(int argc, const char *const *argv, const char *buff)
+CALLER_OWN char *owl_command_exec(int argc, const char *const *argv, const char *buff)
 {
   return owl_function_exec(argc, argv, buff, OWL_OUTPUT_RETURN);
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_command_pexec(int argc, const char *const *argv, const char *buff)
+CALLER_OWN char *owl_command_pexec(int argc, const char *const *argv, const char *buff)
 {
   return owl_function_exec(argc, argv, buff, OWL_OUTPUT_POPUP);
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_command_aexec(int argc, const char *const *argv, const char *buff)
+CALLER_OWN char *owl_command_aexec(int argc, const char *const *argv, const char *buff)
 {
   return owl_function_exec(argc, argv, buff, OWL_OUTPUT_ADMINMSG);
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_command_perl(int argc, const char *const *argv, const char *buff)
+CALLER_OWN char *owl_command_perl(int argc, const char *const *argv, const char *buff)
 {
   return owl_function_perl(argc, argv, buff, OWL_OUTPUT_RETURN);
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_command_pperl(int argc, const char *const *argv, const char *buff)
+CALLER_OWN char *owl_command_pperl(int argc, const char *const *argv, const char *buff)
 {
   return owl_function_perl(argc, argv, buff, OWL_OUTPUT_POPUP);
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_command_aperl(int argc, const char *const *argv, const char *buff)
+CALLER_OWN char *owl_command_aperl(int argc, const char *const *argv, const char *buff)
 {
   return owl_function_perl(argc, argv, buff, OWL_OUTPUT_ADMINMSG);
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_command_multi(int argc, const char *const *argv, const char *buff)
+CALLER_OWN char *owl_command_multi(int argc, const char *const *argv, const char *buff)
 {
   char *lastrv = NULL, *newbuff;
@@ -2594,5 +2594,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_command_getstyle(int argc, const char *const *argv, const char *buff)
+CALLER_OWN char *owl_command_getstyle(int argc, const char *const *argv, const char *buff)
 {
   const char *stylename;
@@ -2637,5 +2637,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_command_with_history(int argc, const char *const *argv, const char *buff)
+CALLER_OWN char *owl_command_with_history(int argc, const char *const *argv, const char *buff)
 {
   owl_history *hist;
Index: context.c
===================================================================
--- context.c	(revision d427f08508a96769e6a7fd429711b6349caf5b57)
+++ context.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -6,5 +6,5 @@
 
 /* TODO: dependency from owl_context -> owl_window is annoying. */
-G_GNUC_WARN_UNUSED_RESULT owl_context *owl_context_new(int mode, void *data, const char *keymap, owl_window *cursor)
+CALLER_OWN owl_context *owl_context_new(int mode, void *data, const char *keymap, owl_window *cursor)
 {
   owl_context *c;
Index: dict.c
===================================================================
--- dict.c	(revision d427f08508a96769e6a7fd429711b6349caf5b57)
+++ dict.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -107,5 +107,5 @@
 /* Doesn't free the value of the element, but does
  * return it so the caller can free it. */
-G_GNUC_WARN_UNUSED_RESULT void *owl_dict_remove_element(owl_dict *d, const char *k)
+CALLER_OWN void *owl_dict_remove_element(owl_dict *d, const char *k)
 {
   int i;
Index: editcontext.c
===================================================================
--- editcontext.c	(revision d427f08508a96769e6a7fd429711b6349caf5b57)
+++ editcontext.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -8,5 +8,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT owl_context *owl_editcontext_new(int mode, owl_editwin *e, const char *keymap, void (*deactivate_cb)(owl_context*), void *cbdata)
+CALLER_OWN owl_context *owl_editcontext_new(int mode, owl_editwin *e, const char *keymap, void (*deactivate_cb)(owl_context*), void *cbdata)
 {
   owl_context *ctx = owl_context_new(mode, owl_editwin_ref(e), keymap,
Index: editwin.c
===================================================================
--- editwin.c	(revision d427f08508a96769e6a7fd429711b6349caf5b57)
+++ editwin.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -61,5 +61,5 @@
 static const char *oe_copy_buf(owl_editwin *e, const char *buf, int len);
 static int oe_copy_region(owl_editwin *e);
-static G_GNUC_WARN_UNUSED_RESULT char *oe_chunk(owl_editwin *e, int start, int end);
+static CALLER_OWN char *oe_chunk(owl_editwin *e, int start, int end);
 static void oe_destroy_cbdata(owl_editwin *e);
 static void oe_dirty(owl_editwin *e);
@@ -70,5 +70,5 @@
 #define WHITESPACE " \n\t"
 
-static G_GNUC_WARN_UNUSED_RESULT owl_editwin *owl_editwin_allocate(void)
+static CALLER_OWN owl_editwin *owl_editwin_allocate(void)
 {
   owl_editwin *e = g_new0(owl_editwin, 1);
@@ -142,5 +142,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT owl_editwin *owl_editwin_new(owl_window *win, int winlines, int wincols, int style, owl_history *hist)
+CALLER_OWN owl_editwin *owl_editwin_new(owl_window *win, int winlines, int wincols, int style, owl_history *hist)
 {
   owl_editwin *e = owl_editwin_allocate();
@@ -1369,5 +1369,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_editwin_get_region(owl_editwin *e)
+CALLER_OWN char *owl_editwin_get_region(owl_editwin *e)
 {
   int start, end;
@@ -1388,5 +1388,5 @@
 }
 
-static G_GNUC_WARN_UNUSED_RESULT char *oe_chunk(owl_editwin *e, int start, int end)
+static CALLER_OWN char *oe_chunk(owl_editwin *e, int start, int end)
 {
   char *p;
Index: filter.c
===================================================================
--- filter.c	(revision d427f08508a96769e6a7fd429711b6349caf5b57)
+++ filter.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -200,5 +200,5 @@
 
 
-char G_GNUC_WARN_UNUSED_RESULT *owl_filter_print(const owl_filter *f)
+char CALLER_OWN *owl_filter_print(const owl_filter *f)
 {
   GString *out = g_string_new("");
Index: fmtext.c
===================================================================
--- fmtext.c	(revision d427f08508a96769e6a7fd429711b6349caf5b57)
+++ fmtext.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -171,5 +171,5 @@
  * freeing the return
  */
-char G_GNUC_WARN_UNUSED_RESULT *owl_fmtext_print_plain(const owl_fmtext *f)
+char CALLER_OWN *owl_fmtext_print_plain(const owl_fmtext *f)
 {
   return owl_strip_format_chars(f->buff->str);
Index: functions.c
===================================================================
--- functions.c	(revision b47045136e3cc870fe10407242759461f1767d62)
+++ functions.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -14,5 +14,5 @@
 #include "filterproc.h"
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_function_command(const char *cmdbuff)
+CALLER_OWN char *owl_function_command(const char *cmdbuff)
 {
   owl_function_debugmsg("executing command: %s", cmdbuff);
@@ -21,5 +21,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_function_command_argv(const char *const *argv, int argc)
+CALLER_OWN char *owl_function_command_argv(const char *const *argv, int argc)
 {
   return owl_cmddict_execute_argv(owl_global_get_cmddict(&g),
@@ -95,5 +95,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_function_style_describe(const char *name)
+CALLER_OWN char *owl_function_style_describe(const char *name)
 {
   const char *desc;
@@ -112,5 +112,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_function_cmd_describe(const char *name)
+CALLER_OWN char *owl_function_cmd_describe(const char *name)
 {
   const owl_cmd *cmd = owl_cmddict_find(owl_global_get_cmddict(&g), name);
@@ -250,5 +250,5 @@
  * owl_global_messagequeue_addmsg() for that.
  */
-G_GNUC_WARN_UNUSED_RESULT owl_message *owl_function_make_outgoing_aim(const char *body, const char *to)
+CALLER_OWN owl_message *owl_function_make_outgoing_aim(const char *body, const char *to)
 {
   owl_message *m;
@@ -271,5 +271,5 @@
  * owl_global_messagequeue_addmsg() for that.
  */
-G_GNUC_WARN_UNUSED_RESULT owl_message *owl_function_make_outgoing_loopback(const char *body)
+CALLER_OWN owl_message *owl_function_make_outgoing_loopback(const char *body)
 {
   owl_message *m;
@@ -1900,5 +1900,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT owl_editwin *owl_function_start_question(const char *line)
+CALLER_OWN owl_editwin *owl_function_start_question(const char *line)
 {
   owl_editwin *tw;
@@ -1915,5 +1915,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT owl_editwin *owl_function_start_password(const char *line)
+CALLER_OWN owl_editwin *owl_function_start_password(const char *line)
 {
   owl_editwin *tw;
@@ -1932,5 +1932,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_function_exec(int argc, const char *const *argv, const char *buff, int type)
+CALLER_OWN char *owl_function_exec(int argc, const char *const *argv, const char *buff, int type)
 {
   /* if type == 1 display in a popup
@@ -1975,5 +1975,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_function_perl(int argc, const char *const *argv, const char *buff, int type)
+CALLER_OWN char *owl_function_perl(int argc, const char *const *argv, const char *buff, int type)
 {
   /* if type == 1 display in a popup
@@ -2145,5 +2145,5 @@
  * Returns the name of the negated filter, which the caller must free.
  */
-G_GNUC_WARN_UNUSED_RESULT char *owl_function_create_negative_filter(const char *filtername)
+CALLER_OWN char *owl_function_create_negative_filter(const char *filtername)
 {
   char *newname;
@@ -2242,5 +2242,5 @@
  * If 'related' is nonzero, encompass unclasses and .d classes as well.
  */
-G_GNUC_WARN_UNUSED_RESULT char *owl_function_classinstfilt(const char *c, const char *i, int related) 
+CALLER_OWN char *owl_function_classinstfilt(const char *c, const char *i, int related) 
 {
   owl_filter *f;
@@ -2329,5 +2329,5 @@
  * the filter, which the caller must free.
  */
-G_GNUC_WARN_UNUSED_RESULT char *owl_function_zuserfilt(const char *longuser)
+CALLER_OWN char *owl_function_zuserfilt(const char *longuser)
 {
   owl_filter *f;
@@ -2375,5 +2375,5 @@
  * Returns the name of the filter, which the caller must free.
  */
-G_GNUC_WARN_UNUSED_RESULT char *owl_function_aimuserfilt(const char *user)
+CALLER_OWN char *owl_function_aimuserfilt(const char *user)
 {
   owl_filter *f;
@@ -2413,5 +2413,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_function_typefilt(const char *type)
+CALLER_OWN char *owl_function_typefilt(const char *type)
 {
   owl_filter *f;
@@ -2469,5 +2469,5 @@
 }
 
-static G_GNUC_WARN_UNUSED_RESULT char *owl_function_smartfilter_cc(const owl_message *m)
+static CALLER_OWN char *owl_function_smartfilter_cc(const owl_message *m)
 {
   const char *ccs;
@@ -2521,5 +2521,5 @@
  *    name to the AIM conversation with that user 
  */
-G_GNUC_WARN_UNUSED_RESULT char *owl_function_smartfilter(int type, int invert_related)
+CALLER_OWN char *owl_function_smartfilter(int type, int invert_related)
 {
   const owl_view *v;
@@ -2860,5 +2860,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_function_keymap_summary(const char *name)
+CALLER_OWN char *owl_function_keymap_summary(const char *name)
 {
   const owl_keymap *km 
@@ -2974,5 +2974,5 @@
 /* strips formatting from ztext and returns the unformatted text. 
  * caller is responsible for freeing. */
-G_GNUC_WARN_UNUSED_RESULT char *owl_function_ztext_stylestrip(const char *zt)
+CALLER_OWN char *owl_function_ztext_stylestrip(const char *zt)
 {
   owl_fmtext fm;
Index: global.c
===================================================================
--- global.c	(revision 43744cedcfc8089755ce50627bca15e27fbe33f7)
+++ global.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -172,5 +172,5 @@
 /* Pops the current context from the context stack and returns it. Caller is
  * responsible for freeing. */
-G_GNUC_WARN_UNUSED_RESULT owl_context *owl_global_pop_context_no_delete(owl_global *g)
+CALLER_OWN owl_context *owl_global_pop_context_no_delete(owl_global *g)
 {
   owl_context *c;
@@ -725,5 +725,5 @@
  * necessary.
  */
-owl_message G_GNUC_WARN_UNUSED_RESULT *owl_global_messagequeue_popmsg(owl_global *g)
+owl_message CALLER_OWN *owl_global_messagequeue_popmsg(owl_global *g)
 {
   owl_message *out;
Index: keybinding.c
===================================================================
--- keybinding.c	(revision d427f08508a96769e6a7fd429711b6349caf5b57)
+++ keybinding.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -14,5 +14,5 @@
 
 /* sets up a new keybinding for a command */
-G_GNUC_WARN_UNUSED_RESULT owl_keybinding *owl_keybinding_new(const char *keyseq, const char *command, void (*function_fn)(void), const char *desc)
+CALLER_OWN owl_keybinding *owl_keybinding_new(const char *keyseq, const char *command, void (*function_fn)(void), const char *desc)
 {
   owl_keybinding *kb = g_new(owl_keybinding, 1);
@@ -85,5 +85,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_keybinding_stack_tostring(int *j, int len)
+CALLER_OWN char *owl_keybinding_stack_tostring(int *j, int len)
 {
   GString *string;
@@ -100,5 +100,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_keybinding_tostring(const owl_keybinding *kb)
+CALLER_OWN char *owl_keybinding_tostring(const owl_keybinding *kb)
 {
   return owl_keybinding_stack_tostring(kb->keys, kb->len);
Index: keymap.c
===================================================================
--- keymap.c	(revision d427f08508a96769e6a7fd429711b6349caf5b57)
+++ keymap.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -80,5 +80,5 @@
 
 /* returns a summary line describing this keymap.  the caller must free. */
-G_GNUC_WARN_UNUSED_RESULT char *owl_keymap_summary(const owl_keymap *km)
+CALLER_OWN char *owl_keymap_summary(const owl_keymap *km)
 {
   if (!km || !km->name || !km->desc) return NULL;
Index: keypress.c
===================================================================
--- keypress.c	(revision d427f08508a96769e6a7fd429711b6349caf5b57)
+++ keypress.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -129,5 +129,5 @@
 /* OWL_META is definied in owl.h */
 
-char G_GNUC_WARN_UNUSED_RESULT *owl_keypress_tostring(int j, int esc)
+char CALLER_OWN *owl_keypress_tostring(int j, int esc)
 {
   GString *kb;
Index: logging.c
===================================================================
--- logging.c	(revision d427f08508a96769e6a7fd429711b6349caf5b57)
+++ logging.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -80,5 +80,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_log_zephyr(const owl_message *m)
+CALLER_OWN char *owl_log_zephyr(const owl_message *m)
 {
     char *tmp = NULL;
@@ -104,5 +104,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_log_aim(const owl_message *m)
+CALLER_OWN char *owl_log_aim(const owl_message *m)
 {
     GString *buffer = NULL;
@@ -122,5 +122,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_log_jabber(const owl_message *m)
+CALLER_OWN char *owl_log_jabber(const owl_message *m)
 {
     GString *buffer = NULL;
@@ -135,5 +135,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_log_generic(const owl_message *m)
+CALLER_OWN char *owl_log_generic(const owl_message *m)
 {
     GString *buffer;
Index: message.c
===================================================================
--- message.c	(revision d427f08508a96769e6a7fd429711b6349caf5b57)
+++ message.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -580,5 +580,5 @@
 
 /* caller must free return value. */
-G_GNUC_WARN_UNUSED_RESULT char *owl_message_get_cc(const owl_message *m)
+CALLER_OWN char *owl_message_get_cc(const owl_message *m)
 {
   const char *cur;
@@ -597,5 +597,5 @@
 
 /* caller must free return value */
-G_GNUC_WARN_UNUSED_RESULT GList *owl_message_get_cc_without_recipient(const owl_message *m)
+CALLER_OWN GList *owl_message_get_cc_without_recipient(const owl_message *m)
 {
   char *cc, *shortuser, *recip;
Index: owl.h
===================================================================
--- owl.h	(revision 95b52d17a566adefc77f07749218fe0cb33a66b2)
+++ owl.h	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -199,4 +199,8 @@
 #define OWL_ENABLE_ZCRYPT 1
 #endif
+
+/* Annotate functions in which the caller owns the return value and is
+ * responsible for ensuring it is freed. */
+#define CALLER_OWN G_GNUC_WARN_UNUSED_RESULT
 
 #define OWL_META(key) ((key)|010000)
@@ -251,5 +255,5 @@
 				 * WARNING:  this approach is hard to make
 				 * thread-safe... */
-  char G_GNUC_WARN_UNUSED_RESULT *(*get_tostring_fn)(const struct _owl_variable *v, const void *val);
+  char CALLER_OWN *(*get_tostring_fn)(const struct _owl_variable *v, const void *val);
                                 /* converts val to a string;
 				 * caller must free the result */
@@ -313,5 +317,5 @@
   
   /* These don't take any context */
-  char G_GNUC_WARN_UNUSED_RESULT *(*cmd_args_fn)(int argc, const char *const *argv, const char *buff);
+  char CALLER_OWN *(*cmd_args_fn)(int argc, const char *const *argv, const char *buff);
 				/* takes argv and the full command as buff.
 				 * caller must free return value if !NULL */
@@ -320,5 +324,5 @@
 
   /* The following also take the active context if it's valid */
-  char G_GNUC_WARN_UNUSED_RESULT *(*cmd_ctxargs_fn)(void *ctx, int argc, const char *const *argv, const char *buff);
+  char CALLER_OWN *(*cmd_ctxargs_fn)(void *ctx, int argc, const char *const *argv, const char *buff);
 				/* takes argv and the full command as buff.
 				 * caller must free return value if !NULL */
Index: perlconfig.c
===================================================================
--- perlconfig.c	(revision d427f08508a96769e6a7fd429711b6349caf5b57)
+++ perlconfig.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -23,5 +23,5 @@
 
 
-G_GNUC_WARN_UNUSED_RESULT SV *owl_new_sv(const char * str)
+CALLER_OWN SV *owl_new_sv(const char * str)
 {
   SV *ret = newSVpv(str, 0);
@@ -36,5 +36,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT AV *owl_new_av(const owl_list *l, SV *(*to_sv)(const void *))
+CALLER_OWN AV *owl_new_av(const owl_list *l, SV *(*to_sv)(const void *))
 {
   AV *ret;
@@ -52,5 +52,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT HV *owl_new_hv(const owl_dict *d, SV *(*to_sv)(const void *))
+CALLER_OWN HV *owl_new_hv(const owl_dict *d, SV *(*to_sv)(const void *))
 {
   HV *ret;
@@ -75,5 +75,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT SV *owl_perlconfig_message2hashref(const owl_message *m)
+CALLER_OWN SV *owl_perlconfig_message2hashref(const owl_message *m)
 {
   HV *h, *stash;
@@ -165,5 +165,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT SV *owl_perlconfig_curmessage2hashref(void)
+CALLER_OWN SV *owl_perlconfig_curmessage2hashref(void)
 {
   int curmsg;
@@ -183,5 +183,5 @@
    This has been somewhat addressed, but is still not lossless.
  */
-G_GNUC_WARN_UNUSED_RESULT owl_message *owl_perlconfig_hashref2message(SV *msg)
+CALLER_OWN owl_message *owl_perlconfig_hashref2message(SV *msg)
 {
   owl_message * m;
@@ -251,5 +251,5 @@
 /* Calls in a scalar context, passing it a hash reference.
    If return value is non-null, caller must free. */
-G_GNUC_WARN_UNUSED_RESULT char *owl_perlconfig_call_with_message(const char *subname, const owl_message *m)
+CALLER_OWN char *owl_perlconfig_call_with_message(const char *subname, const owl_message *m)
 {
   dSP ;
@@ -300,5 +300,5 @@
    If the return value is non-null, the caller must free it.
  */
-G_GNUC_WARN_UNUSED_RESULT char *owl_perlconfig_message_call_method(const owl_message *m, const char *method, int argc, const char **argv)
+CALLER_OWN char *owl_perlconfig_message_call_method(const owl_message *m, const char *method, int argc, const char **argv)
 {
   dSP;
@@ -350,5 +350,5 @@
 
 /* caller must free result, if not NULL */
-G_GNUC_WARN_UNUSED_RESULT char *owl_perlconfig_initperl(const char *file, int *Pargc, char ***Pargv, char ***Penv)
+CALLER_OWN char *owl_perlconfig_initperl(const char *file, int *Pargc, char ***Pargv, char ***Penv)
 {
   int ret;
@@ -436,5 +436,5 @@
 
 /* caller is responsible for freeing returned string */
-G_GNUC_WARN_UNUSED_RESULT char *owl_perlconfig_execute(const char *line)
+CALLER_OWN char *owl_perlconfig_execute(const char *line)
 {
   STRLEN len;
@@ -506,5 +506,5 @@
 
 /* caller must free the result */
-G_GNUC_WARN_UNUSED_RESULT char *owl_perlconfig_perlcmd(const owl_cmd *cmd, int argc, const char *const *argv)
+CALLER_OWN char *owl_perlconfig_perlcmd(const owl_cmd *cmd, int argc, const char *const *argv)
 {
   int i, count;
Index: popwin.c
===================================================================
--- popwin.c	(revision d427f08508a96769e6a7fd429711b6349caf5b57)
+++ popwin.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -1,5 +1,5 @@
 #include "owl.h"
 
-G_GNUC_WARN_UNUSED_RESULT owl_popwin *owl_popwin_new(void)
+CALLER_OWN owl_popwin *owl_popwin_new(void)
 {
   owl_popwin *pw = g_new0(owl_popwin, 1);
Index: text.c
===================================================================
--- text.c	(revision d427f08508a96769e6a7fd429711b6349caf5b57)
+++ text.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -7,5 +7,5 @@
 /* Returns a copy of 'in' with each line indented 'n'
  * characters. Result must be freed with g_free. */
-G_GNUC_WARN_UNUSED_RESULT char *owl_text_indent(const char *in, int n)
+CALLER_OWN char *owl_text_indent(const char *in, int n)
 {
   const char *ptr1, *ptr2, *last;
@@ -48,5 +48,5 @@
 
 /* caller must free the return */
-G_GNUC_WARN_UNUSED_RESULT char *owl_text_htmlstrip(const char *in)
+CALLER_OWN char *owl_text_htmlstrip(const char *in)
 {
   const char *ptr1, *end, *ptr2, *ptr3;
@@ -129,5 +129,5 @@
 
 /* Caller must free return */
-G_GNUC_WARN_UNUSED_RESULT char *owl_text_expand_tabs(const char *in)
+CALLER_OWN char *owl_text_expand_tabs(const char *in)
 {
   int len = 0;
@@ -188,5 +188,5 @@
 
 /* caller must free the return */
-G_GNUC_WARN_UNUSED_RESULT char *owl_text_wordwrap(const char *in, int col)
+CALLER_OWN char *owl_text_wordwrap(const char *in, int col)
 {
   char *out;
@@ -269,5 +269,5 @@
  * Caller must free returned string.
  */
-G_GNUC_WARN_UNUSED_RESULT char *owl_text_substitute(const char *in, const char *from, const char *to)
+CALLER_OWN char *owl_text_substitute(const char *in, const char *from, const char *to)
 {
   char **split = g_strsplit(in, from, 0), *out;
@@ -284,5 +284,5 @@
  * On success returns the string, on error returns NULL.
  */
-G_GNUC_WARN_UNUSED_RESULT char *owl_text_quote(const char *in, const char *toquote, const char *quotestr)
+CALLER_OWN char *owl_text_quote(const char *in, const char *toquote, const char *quotestr)
 {
   int i, x, r, place, escape;
Index: util.c
===================================================================
--- util.c	(revision d427f08508a96769e6a7fd429711b6349caf5b57)
+++ util.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -35,5 +35,5 @@
  * duplicate slashes are removed.  Caller must free the return.
  */
-G_GNUC_WARN_UNUSED_RESULT char *owl_util_makepath(const char *in)
+CALLER_OWN char *owl_util_makepath(const char *in)
 {
   int i, j, x;
@@ -102,5 +102,5 @@
    to -1, argv will be NULL and the caller does not need to free anything. The
    returned vector is NULL-terminated. */
-G_GNUC_WARN_UNUSED_RESULT char **owl_parseline(const char *line, int *argc)
+CALLER_OWN char **owl_parseline(const char *line, int *argc)
 {
   GPtrArray *argv;
@@ -245,5 +245,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_string_build_quoted(const char *tmpl, ...)
+CALLER_OWN char *owl_string_build_quoted(const char *tmpl, ...)
 {
   GString *buf = g_string_new("");
@@ -257,5 +257,5 @@
 /* Returns a quoted version of arg suitable for placing in a
  * command-line. Result should be freed with g_free. */
-G_GNUC_WARN_UNUSED_RESULT char *owl_arg_quote(const char *arg)
+CALLER_OWN char *owl_arg_quote(const char *arg)
 {
   GString *buf = g_string_new("");;
@@ -265,5 +265,5 @@
 
 /* caller must free the return */
-G_GNUC_WARN_UNUSED_RESULT char *owl_util_minutes_to_timestr(int in)
+CALLER_OWN char *owl_util_minutes_to_timestr(int in)
 {
   int days, hours;
@@ -331,5 +331,5 @@
 
 /* Get the default tty name.  Caller must free the return */
-G_GNUC_WARN_UNUSED_RESULT char *owl_util_get_default_tty(void)
+CALLER_OWN char *owl_util_get_default_tty(void)
 {
   const char *tmp;
@@ -353,5 +353,5 @@
  * return.
  */
-G_GNUC_WARN_UNUSED_RESULT char *owl_util_stripnewlines(const char *in)
+CALLER_OWN char *owl_util_stripnewlines(const char *in)
 {
   
@@ -384,5 +384,5 @@
  * Error conditions are the same as g_file_read_link.
  */
-G_GNUC_WARN_UNUSED_RESULT gchar *owl_util_recursive_resolve_link(const char *filename)
+CALLER_OWN gchar *owl_util_recursive_resolve_link(const char *filename)
 {
   gchar *last_path = g_strdup(filename);
@@ -511,5 +511,5 @@
    The caller is responsible for freeing the allocated string.
 */
-G_GNUC_WARN_UNUSED_RESULT char *owl_util_baseclass(const char *class)
+CALLER_OWN char *owl_util_baseclass(const char *class)
 {
   char *start, *end;
@@ -547,5 +547,5 @@
 /* Strips format characters from a valid utf-8 string. Returns the
    empty string if 'in' does not validate.  Caller must free the return. */
-G_GNUC_WARN_UNUSED_RESULT char *owl_strip_format_chars(const char *in)
+CALLER_OWN char *owl_strip_format_chars(const char *in)
 {
   char *r;
@@ -586,5 +586,5 @@
  * Caller must free the return.
  */
-G_GNUC_WARN_UNUSED_RESULT char *owl_validate_or_convert(const char *in)
+CALLER_OWN char *owl_validate_or_convert(const char *in)
 {
   if (g_utf8_validate(in, -1, NULL)) {
@@ -602,5 +602,5 @@
  * Caller must free the return.
  */
-G_GNUC_WARN_UNUSED_RESULT char *owl_validate_utf8(const char *in)
+CALLER_OWN char *owl_validate_utf8(const char *in)
 {
   char *out;
@@ -635,5 +635,5 @@
 
 /* caller must free the return */
-G_GNUC_WARN_UNUSED_RESULT char *owl_escape_highbit(const char *str)
+CALLER_OWN char *owl_escape_highbit(const char *str)
 {
   GString *out = g_string_new("");
@@ -698,5 +698,5 @@
 
 /* Read the rest of the input available in fp into a string. */
-G_GNUC_WARN_UNUSED_RESULT char *owl_slurp(FILE *fp)
+CALLER_OWN char *owl_slurp(FILE *fp)
 {
   char *buf = NULL;
Index: variable.c
===================================================================
--- variable.c	(revision d427f08508a96769e6a7fd429711b6349caf5b57)
+++ variable.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -646,5 +646,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT owl_variable *owl_variable_newvar(const char *name, const char *summary, const char *description)
+CALLER_OWN owl_variable *owl_variable_newvar(const char *name, const char *summary, const char *description)
 {
   owl_variable * var = g_new0(owl_variable, 1);
@@ -825,5 +825,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_variable_get_tostring(const owl_vardict *d, const char *name)
+CALLER_OWN char *owl_variable_get_tostring(const owl_vardict *d, const char *name)
 {
   owl_variable *v;
@@ -834,5 +834,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_variable_get_default_tostring(const owl_vardict *d, const char *name)
+CALLER_OWN char *owl_variable_get_default_tostring(const owl_vardict *d, const char *name)
 {
   owl_variable *v;
@@ -995,5 +995,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_variable_bool_get_tostring_default(const owl_variable *v, const void *val)
+CALLER_OWN char *owl_variable_bool_get_tostring_default(const owl_variable *v, const void *val)
 {
   if (val == NULL) {
@@ -1031,5 +1031,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_variable_int_get_tostring_default(const owl_variable *v, const void *val)
+CALLER_OWN char *owl_variable_int_get_tostring_default(const owl_variable *v, const void *val)
 {
   if (val == NULL) {
@@ -1071,5 +1071,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_variable_enum_get_tostring(const owl_variable *v, const void *val)
+CALLER_OWN char *owl_variable_enum_get_tostring(const owl_variable *v, const void *val)
 {
   char **enums;
@@ -1112,5 +1112,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_variable_string_get_tostring_default(const owl_variable *v, const void *val)
+CALLER_OWN char *owl_variable_string_get_tostring_default(const owl_variable *v, const void *val)
 {
   if (val == NULL) {
Index: viewwin.c
===================================================================
--- viewwin.c	(revision d427f08508a96769e6a7fd429711b6349caf5b57)
+++ viewwin.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -12,5 +12,5 @@
  * will be used by the viewwin
  */
-G_GNUC_WARN_UNUSED_RESULT owl_viewwin *owl_viewwin_new_text(owl_window *win, const char *text)
+CALLER_OWN owl_viewwin *owl_viewwin_new_text(owl_window *win, const char *text)
 {
   owl_viewwin *v = g_new0(owl_viewwin, 1);
@@ -34,5 +34,5 @@
  * will be used by the viewwin
  */
-G_GNUC_WARN_UNUSED_RESULT owl_viewwin *owl_viewwin_new_fmtext(owl_window *win, const owl_fmtext *fmtext)
+CALLER_OWN owl_viewwin *owl_viewwin_new_fmtext(owl_window *win, const owl_fmtext *fmtext)
 {
   char *text;
@@ -237,5 +237,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT owl_editwin *owl_viewwin_set_typwin_active(owl_viewwin *v, owl_history *hist) {
+CALLER_OWN owl_editwin *owl_viewwin_set_typwin_active(owl_viewwin *v, owl_history *hist) {
   int lines, cols;
   owl_editwin *cmdline;
Index: window.c
===================================================================
--- window.c	(revision d427f08508a96769e6a7fd429711b6349caf5b57)
+++ window.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -569,5 +569,5 @@
 };
 
-G_GNUC_WARN_UNUSED_RESULT GSource *owl_window_redraw_source_new(void)
+CALLER_OWN GSource *owl_window_redraw_source_new(void)
 {
   GSource *source;
Index: zcrypt.c
===================================================================
--- zcrypt.c	(revision d427f08508a96769e6a7fd429711b6349caf5b57)
+++ zcrypt.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -27,4 +27,8 @@
 #include "filterproc.h"
 
+/* Annotate functions in which the caller owns the return value and is
+ * responsible for ensuring it is freed. */
+#define CALLER_OWN G_GNUC_WARN_UNUSED_RESULT
+
 #define MAX_KEY      128
 #define MAX_LINE     128
@@ -53,8 +57,8 @@
 } ZWRITEOPTIONS;
 
-G_GNUC_WARN_UNUSED_RESULT char *GetZephyrVarKeyFile(const char *whoami, const char *class, const char *instance);
+CALLER_OWN char *GetZephyrVarKeyFile(const char *whoami, const char *class, const char *instance);
 int ParseCryptSpec(const char *spec, const char **keyfile);
-G_GNUC_WARN_UNUSED_RESULT char *BuildArgString(char **argv, int start, int end);
-G_GNUC_WARN_UNUSED_RESULT char *read_keystring(const char *keyfile);
+CALLER_OWN char *BuildArgString(char **argv, int start, int end);
+CALLER_OWN char *read_keystring(const char *keyfile);
 
 int do_encrypt(int zephyr, const char *class, const char *instance,
@@ -364,5 +368,5 @@
 /* Build a space-separated string from argv from elements between start  *
  * and end - 1.  malloc()'s the returned string. */
-G_GNUC_WARN_UNUSED_RESULT char *BuildArgString(char **argv, int start, int end)
+CALLER_OWN char *BuildArgString(char **argv, int start, int end)
 {
   int len = 1;
@@ -401,5 +405,5 @@
 #define MAX_SEARCH 3
 /* Find the class/instance in the .crypt-table */
-G_GNUC_WARN_UNUSED_RESULT char *GetZephyrVarKeyFile(const char *whoami, const char *class, const char *instance)
+CALLER_OWN char *GetZephyrVarKeyFile(const char *whoami, const char *class, const char *instance)
 {
   char *keyfile = NULL;
@@ -579,5 +583,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *slurp_stdin(int ignoredot, int *length) {
+CALLER_OWN char *slurp_stdin(int ignoredot, int *length) {
   char *buf;
   char *inptr;
@@ -611,5 +615,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *GetInputBuffer(ZWRITEOPTIONS *zoptions, int *length) {
+CALLER_OWN char *GetInputBuffer(ZWRITEOPTIONS *zoptions, int *length) {
   char *buf;
 
@@ -637,5 +641,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *read_keystring(const char *keyfile) {
+CALLER_OWN char *read_keystring(const char *keyfile) {
   char *keystring;
   FILE *fkey = fopen(keyfile, "r");
Index: zephyr.c
===================================================================
--- zephyr.c	(revision d427f08508a96769e6a7fd429711b6349caf5b57)
+++ zephyr.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -524,5 +524,5 @@
  */
 #ifdef HAVE_LIBZEPHYR
-G_GNUC_WARN_UNUSED_RESULT char *owl_zephyr_get_field(const ZNotice_t *n, int j)
+CALLER_OWN char *owl_zephyr_get_field(const ZNotice_t *n, int j)
 {
   int i, count, save;
@@ -552,5 +552,5 @@
 }
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_zephyr_get_field_as_utf8(const ZNotice_t *n, int j)
+CALLER_OWN char *owl_zephyr_get_field_as_utf8(const ZNotice_t *n, int j)
 {
   int i, count, save;
@@ -584,9 +584,9 @@
 }
 #else
-G_GNUC_WARN_UNUSED_RESULT char *owl_zephyr_get_field(void *n, int j)
+CALLER_OWN char *owl_zephyr_get_field(void *n, int j)
 {
   return(g_strdup(""));
 }
-G_GNUC_WARN_UNUSED_RESULT char *owl_zephyr_get_field_as_utf8(void *n, int j)
+CALLER_OWN char *owl_zephyr_get_field_as_utf8(void *n, int j)
 {
   return owl_zephyr_get_field(n, j);
@@ -621,5 +621,5 @@
  * caller must free the return
  */
-G_GNUC_WARN_UNUSED_RESULT char *owl_zephyr_get_message(const ZNotice_t *n, const owl_message *m)
+CALLER_OWN char *owl_zephyr_get_message(const ZNotice_t *n, const owl_message *m)
 {
 #define OWL_NFIELDS	5
@@ -942,5 +942,5 @@
 #endif
 
-G_GNUC_WARN_UNUSED_RESULT char *owl_zephyr_zlocate(const char *user, int auth)
+CALLER_OWN char *owl_zephyr_zlocate(const char *user, int auth)
 {
 #ifdef HAVE_LIBZEPHYR
@@ -1042,5 +1042,5 @@
 
 /* caller must free the return */
-G_GNUC_WARN_UNUSED_RESULT char *owl_zephyr_makesubline(const char *class, const char *inst, const char *recip)
+CALLER_OWN char *owl_zephyr_makesubline(const char *class, const char *inst, const char *recip)
 {
   return g_strdup_printf("%s,%s,%s\n", class, inst, !strcmp(recip, "") ? "*" : recip);
@@ -1122,5 +1122,5 @@
  * free the return.
  */
-G_GNUC_WARN_UNUSED_RESULT char *owl_zephyr_getsubs(void)
+CALLER_OWN char *owl_zephyr_getsubs(void)
 {
 #ifdef HAVE_LIBZEPHYR
@@ -1242,5 +1242,5 @@
  * The caller must free the return
  */
-G_GNUC_WARN_UNUSED_RESULT char *short_zuser(const char *in)
+CALLER_OWN char *short_zuser(const char *in)
 {
   char *ptr = strrchr(in, '@');
@@ -1254,5 +1254,5 @@
  * The caller must free the return.
  */
-G_GNUC_WARN_UNUSED_RESULT char *long_zuser(const char *in)
+CALLER_OWN char *long_zuser(const char *in)
 {
   char *ptr = strrchr(in, '@');
@@ -1282,5 +1282,5 @@
  * caller must free the return.
  */
-G_GNUC_WARN_UNUSED_RESULT char *owl_zephyr_smartstripped_user(const char *in)
+CALLER_OWN char *owl_zephyr_smartstripped_user(const char *in)
 {
   char *slash, *dot, *realm, *out;
Index: zwrite.c
===================================================================
--- zwrite.c	(revision d427f08508a96769e6a7fd429711b6349caf5b57)
+++ zwrite.c	(revision 6829afcb7133217c6afdbd7634452d0fabdeaa4f)
@@ -5,5 +5,5 @@
 #include "owl.h"
 
-G_GNUC_WARN_UNUSED_RESULT owl_zwrite *owl_zwrite_new(const char *line)
+CALLER_OWN owl_zwrite *owl_zwrite_new(const char *line)
 {
   owl_zwrite *z = g_new(owl_zwrite, 1);
@@ -321,5 +321,5 @@
 
 /* Caller must free the result. */
-G_GNUC_WARN_UNUSED_RESULT char *owl_zwrite_get_recip_n_with_realm(const owl_zwrite *z, int n)
+CALLER_OWN char *owl_zwrite_get_recip_n_with_realm(const owl_zwrite *z, int n)
 {
   if (z->realm[0]) {
@@ -370,5 +370,5 @@
  * If not a CC, only the recip_index'th user will be replied to.
  */
-G_GNUC_WARN_UNUSED_RESULT char *owl_zwrite_get_replyline(const owl_zwrite *z, int recip_index)
+CALLER_OWN char *owl_zwrite_get_replyline(const owl_zwrite *z, int recip_index)
 {
   /* Match ordering in zwrite help. */
