[ovs-dev] [PATCH] ovsdb-data: Fix warnings.

Ethan Jackson ethan at nicira.com
Thu Jan 13 18:17:08 UTC 2011


Yep that fixes it for me.


On Thu, Jan 13, 2011 at 9:04 AM, Ben Pfaff <blp at nicira.com> wrote:
> On Wed, Jan 12, 2011 at 06:21:15PM -0800, Ethan Jackson wrote:
>> This commit fixes "may be used uninitialized" warnings in
>> ovsdb-data.c
>
> I think that your compiler probably sees that unwrap_json() doesn't
> always assign to its 'value' argument.  I think I'd rather make it
> always assign a value, something like the following.  Does that fix the
> warning for you, too?
>
> diff --git a/lib/ovsdb-data.c b/lib/ovsdb-data.c
> index 492da7f..20d333e 100644
> --- a/lib/ovsdb-data.c
> +++ b/lib/ovsdb-data.c
> @@ -264,6 +264,7 @@ unwrap_json(const struct json *json, const char *name,
>         || (name && strcmp(json->u.array.elems[0]->u.string, name))
>         || json->u.array.elems[1]->type != value_type)
>     {
> +        *value = NULL;
>         return ovsdb_syntax_error(json, NULL, "expected [\"%s\", <%s>]", name,
>                                   json_type_to_string(value_type));
>     }
>




More information about the dev mailing list