Re: [PATCH 7/9] configurator: Fix compiler warning with compare

David Gibson <[email protected]> Tue, 20 Sep 2016 15:09:23 +1000
Newsgroups org.ozlabs.lists.ccan
Message-ID <20160920050923.GQ20488@umbus>
On Sun, Sep 18, 2016 at 06:52:04PM -0600, Kevin Locke wrote:
> Visual Studio prints warning C4706 "assignment within conditional
> expression" when there is an assignment without a comparison in a
> conditional expression.  Therefore, to silence the warning, add an
> explicit comparison.
> 
> Signed-off-by: Kevin Locke <[email protected]>

Signed-off-by: David Gibson <[email protected]>

> ---
>  tools/configurator/configurator.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/configurator/configurator.c b/tools/configurator/configurator.c
> index 0386930..0c30aff 100644
> --- a/tools/configurator/configurator.c
> +++ b/tools/configurator/configurator.c
> @@ -535,7 +535,7 @@ static bool run_test(const char *cmd, struct test *test)
>  		char *dep;
>  
>  		/* Space-separated dependencies, could be ! for inverse. */
> -		while ((len = strcspn(deps, " "))) {
> +		while ((len = strcspn(deps, " ")) != 0) {
>  			bool positive = true;
>  			if (deps[len]) {
>  				dep = strdup(deps);

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

_______________________________________________
ccan mailing list
[email protected]
https://lists.ozlabs.org/listinfo/ccan
signature.asc (application/pgp-signature, 819 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJX4MSDAAoJEGw4ysog2bOSHd8P/0Nh1vz6dMsqpviVxlyu5n0G
pqsV6GGtkEMNLRhJSqOd1t0IQYpJCQUXGxqNNzbqowubOWXEYls4EgtDvQTmFUks
molWPpEn5AYoO34O7/p39/ZtO7ozhxVCEA5rT2aR5XTtEc520sme2tqteaadBrE0
40WJAIjclNXwNyzOiHyznw+XRUDEqZR9jRPFYQFsxu3CEis91kc1/qNOglK9R4vL
Uti+maNBDKYK8m51BZCZqln+j+lQmVmFyp5zfxHnIDejfUZtnp3/E7vFR1jPOOiu
APLY7g33NO0Il/OtS0LS3xVuddLqcLNxhmxb/MZ4L0hcGRkyYAXnDRQYYxNQD5mI
NTOj+ONu3j19OGcusYrcTLo6cs0jZafiRZmXuR+miw9YiHgGdfS8jcy9fbIktFx2
uHaoSBpsPZA7j4GE1Qlx1FNXwrpxoDG/BpOidNb4evOGUUsQ3C4gKfJldIu+FLju
x0gn/hKn9FI6VTIkjgGpRKyFLpOnNrNMlrubjvwsP3iVoL1dYnIpFUT6jVumOvtF
QSpWFIl/erqctlu1UyCAs5LU0Ojwq3hv9Pu+MKV+pfJAbU8ROW3kWozOsBLqB+Tk
QvpovylC3poIZAV12pXOxLZBF/X4p3klEP8ht5QP2lR6v0skYtNsPZ2oa1RmNyC7
dquWnJpHv94IIIqBy+w3
=ZnXn
-----END PGP SIGNATURE-----