Skip to content

Commit

Permalink
error.c: don't return value for void function
Browse files Browse the repository at this point in the history
It is invalid to return a value from a function
returning void.

[C99 6.8.6.4 says "A return statement with an expression shall not
appear in a function whose return type is void" but gcc 4.6.3 with QEMU
compile flags does not complain.  It's still worth fixing this.  Stefan]

Signed-off-by: Amos Kong <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
  • Loading branch information
amoskong authored and Stefan Hajnoczi committed Apr 20, 2012
1 parent 51006bb commit 0ed6dc1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion error.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ QDict *error_get_data(Error *err)
void error_set_field(Error *err, const char *field, const char *value)
{
QDict *dict = qdict_get_qdict(err->obj, "data");
return qdict_put(dict, field, qstring_from_str(value));
qdict_put(dict, field, qstring_from_str(value));
}

void error_free(Error *err)
Expand Down

0 comments on commit 0ed6dc1

Please sign in to comment.