Re: [RFC PATCH 3/9] lib: fix messages.c build warn

Subject: Re: [RFC PATCH 3/9] lib: fix messages.c build warn

Date: Sat, 7 Jan 2012 19:26:18 -0500

To: Jani Nikula

Cc: notmuch@notmuchmail.org

From: Austin Clements


I don't have much opinion on the other patches in this series (the C99
variadic macro stuff is unfortunate), but this one should go in.

Quoth Jani Nikula on Jan 08 at  1:26 am:
> lib/messages.c: In function ‘notmuch_messages_move_to_next’:
> lib/messages.c:131:2: warning: ISO C forbids ‘return’ with expression, in function returning void [-pedantic]
> 
> Signed-off-by: Jani Nikula <jani@nikula.org>
> ---
>  lib/messages.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/messages.c b/lib/messages.c
> index 7bcd1ab..1121864 100644
> --- a/lib/messages.c
> +++ b/lib/messages.c
> @@ -127,8 +127,10 @@ notmuch_messages_get (notmuch_messages_t *messages)
>  void
>  notmuch_messages_move_to_next (notmuch_messages_t *messages)
>  {
> -    if (! messages->is_of_list_type)
> -	return _notmuch_mset_messages_move_to_next (messages);
> +    if (! messages->is_of_list_type) {
> +	_notmuch_mset_messages_move_to_next (messages);
> +	return;
> +    }
>  
>      if (messages->iterator == NULL)
>  	return;

Thread: