[sane-devel] C undefined operations in sane-backends-1.0.7-beta1

Tim Waugh twaugh@redhat.com
Wed, 23 Jan 2002 22:43:48 +0000


--2mNuWrpDTYoom6W8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Jan 23, 2002 at 09:43:35PM +0100, Henning Meier-Geinitz wrote:

> This is with gcc-3.x? I don't get them with gcc 2.95.4.

Yes.

> > They
> > are for things like:
> >=20
> > 	bit =3D ++bit % 8;
> >=20
> > which are indeed undefined.
>=20
> Because it's not clear if bit should be incremented and then the right
> side assigned to it or vice versa? Or what's the excat problem?

Yes, that's right.  There is only one sequence point in 'bit =3D ++bit %
8;', at the end, and so the operations can happen in any order.  There
are two assignments to 'bit': the '=3D' operation and the '++'
operation.

Tim.
*/

--2mNuWrpDTYoom6W8
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8TzyfyaXy9qA00+cRAjx6AJ9M1v7C2u+fXf5O8WlnLHa+ycLdDwCgiSrC
sv/4ha/l/xyC63xuKYVeaEI=
=Af0O
-----END PGP SIGNATURE-----

--2mNuWrpDTYoom6W8--