[Libguestfs] [PATCH] fix fuse_opt_add_opt_escaped return type

Richard W.M. Jones rjones at redhat.com
Tue Sep 4 16:27:54 UTC 2012


On Tue, Sep 04, 2012 at 05:43:39PM +0200, Olaf Hering wrote:
> I: Program returns random data in a function
> E: libguestfs no-return-in-nonvoid-function guestmount.c:75
> 
> The function fuse_opt_add_opt_escaped has only one caller and a return
> code is not checked.
> 
> Signed-off-by: Olaf Hering <olaf at aepfle.de>
> ---
> 
> diff --git a/fuse/guestmount.c b/fuse/guestmount.c
> index 17e94ba..1eb0553 100644
> --- a/fuse/guestmount.c
> +++ b/fuse/guestmount.c
> @@ -49,7 +49,7 @@ static int write_pid_file (const char *pid_file, pid_t pid);
>   * Copyright (C) 2001-2007  Miklos Szeredi <miklos at szeredi.hu>
>   * This [function] can be distributed under the terms of the GNU LGPLv2.
>   */
> -static int
> +static void
>  fuse_opt_add_opt_escaped (char **opts, const char *opt)

Thanks - pushed.

I see what happened here:

(1) The upstream fuse_opt_add_opt_escaped function returns int.
However I rewrote this copy of the function so much that it no longer
returned anything.

(2) Because the function is not needed if you have recent fuse, we
weren't testing this so there were no gcc warnings.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
New in Fedora 11: Fedora Windows cross-compiler. Compile Windows
programs, test, and build Windows installers. Over 70 libraries supprt'd
http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw




More information about the Libguestfs mailing list