Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Jan 2021 16:21:37 -0500
From:      Charlie Li <ml+freebsd@vishwin.info>
To:        Ed Maste <emaste@FreeBSD.org>, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   Re: git: 86f33b5fcf60 - main - elfctl: allow features to be specified by value
Message-ID:  <7165ee25-4328-7ac0-5f5a-fc8089c6cc9d@vishwin.info>
In-Reply-To: <202101221940.10MJeTcd061452@gitrepo.freebsd.org>
References:  <202101221940.10MJeTcd061452@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--lJ2d6u1435yrBaIP6P5SE63slh1EHO00l
Content-Type: multipart/mixed; boundary="F0Wtt5Bw4fn0DXabyrBz8sQVisYnKaIqA";
 protected-headers="v1"
From: Charlie Li <ml+freebsd@vishwin.info>
To: Ed Maste <emaste@FreeBSD.org>, src-committers@FreeBSD.org,
 dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Message-ID: <7165ee25-4328-7ac0-5f5a-fc8089c6cc9d@vishwin.info>
Subject: Re: git: 86f33b5fcf60 - main - elfctl: allow features to be specified
 by value
References: <202101221940.10MJeTcd061452@gitrepo.freebsd.org>
In-Reply-To: <202101221940.10MJeTcd061452@gitrepo.freebsd.org>

--F0Wtt5Bw4fn0DXabyrBz8sQVisYnKaIqA
Content-Type: text/plain; charset=utf-8
Content-Language: en-GB
Content-Transfer-Encoding: quoted-printable

Ed Maste wrote:
> diff --git a/usr.bin/elfctl/elfctl.c b/usr.bin/elfctl/elfctl.c
> index 20a2c5b95444..f641b63e32bd 100644
> --- a/usr.bin/elfctl/elfctl.c
> +++ b/usr.bin/elfctl/elfctl.c
> @@ -245,9 +247,26 @@ convert_to_feature_val(char *feature_str, uint32_t=
 *feature_val)
>  			}
>  		}
>  		if (i =3D=3D len) {
> -			warnx("%s is not a valid feature", feature);
> -			if (!iflag)
> -				return (false);
> +			if (isdigit(feature[0])) {
> +				char *eptr;
> +				long val;
> +
> +				errno =3D 0;
> +				val =3D strtol(feature, &eptr, 0);
> +				if (eptr =3D=3D feature || *eptr !=3D '\0')
> +					errno =3D EINVAL;
> +				else if (val > UINT_MAX)
> +					errno =3D ERANGE;
> +				if (errno !=3D 0) {
> +					warn("%s invalid", feature);
> +					return (false);
> +				}
> +				input !=3D val;
> +			} else {
> +				warnx("%s is not a valid feature", feature);
> +				if (!iflag)
> +					return (false);
> +			}
>  		}
>  	}
> =20
Build fails:

--- elfctl.o ---
/usr/src/usr.bin/elfctl/elfctl.c:264:11: error: inequality comparison
result unused [-Werror,-Wunused-comparison]
                                input !=3D val;
                                ~~~~~~^~~~~~
/usr/src/usr.bin/elfctl/elfctl.c:264:11: note: use '|=3D' to turn this
inequality comparison into an or-assignment
                                input !=3D val;
                                      ^~
                                      |=3D
1 error generated.
*** [elfctl.o] Error code 1

make[4]: stopped in /usr/src/usr.bin/elfctl

--=20
Charlie Li
=E2=80=A6nope, still don't have an exit line.

(This email address is for mailing list use; replace local-part with
vishwin for off-list communication if possible)


--F0Wtt5Bw4fn0DXabyrBz8sQVisYnKaIqA--

--lJ2d6u1435yrBaIP6P5SE63slh1EHO00l
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsF5BAABCAAjFiEE/3/Cqr5a+41PbEb+jnB43vIDq2wFAmALQeEFAwAAAAAACgkQjnB43vIDq2zW
iw/7BKTewmqWRtxuxi9mD4htkB7zS5KAwDKtBhKBd+VwiWhMu1Px3V5DUWYXOyvHJIdZyf5V7sUS
pJzm+r3+89vqJQqTqHSrytt5fMGBek35udJQM61CNNw7m5QpyspqYd4Kd8eMD19TAFJvXS6ozZpW
v5jJg8vhlpjQlm4H9hRLKcra9qHAAzUz/F6wXUx/ZwQJO3YyFnqHWBYZ8KJJlzXAA6tr7BmrTTdI
62ig2zI+EnLcIUexmL06V4khtPzYeCoYz1wmHrKs3QQrtuVodBc3wp8DfgslVcIP9v11RgwjyRYK
LhMAaIaOVndfpH/BSsKtIyOwYCbCFiUVdvAfG5t1CpWxZMwyBgjls9KDuojT430ekuQHrcvrp0O4
/y/jNjRpHQv5H0ZK4tWdjck0Lw5Qy3StlyYfSQnbJB6x97Dh0RF2SsR+6TuKBs8V0T2UehM1ZzzD
bamDxSNsy2msVq7V2gdmvfZ/GjrF1Dz2BFqzwWEccOqjeLvC5ub1zreDdHreOlsEL/KRnEJwNRYj
gBszjwyms+A3hgwR/QCCKA/gamtaIIlyNz5Fbg3GrY+S5pCx1dEO764x0JKrF/y5TMnKGuKjDZ+A
jJ8w3b51YeYYKtFbqPA2J2XsbzRye+N3NnuMdv4Ekv6iaXeDzmZ1GTEIHiQChb4HM6SU99OtKbz9
GyQ=
=kVX0
-----END PGP SIGNATURE-----

--lJ2d6u1435yrBaIP6P5SE63slh1EHO00l--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7165ee25-4328-7ac0-5f5a-fc8089c6cc9d>