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

Tim Waugh twaugh at redhat.com
Wed Jan 23 22:43:48 GMT 2002


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:
> > 
> > 	bit = ++bit % 8;
> > 
> > which are indeed undefined.
> 
> 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 = ++bit %
8;', at the end, and so the operations can happen in any order.  There
are two assignments to 'bit': the '=' operation and the '++'
operation.

Tim.
*/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/sane-devel/attachments/20020123/71878926/attachment.sig>


More information about the sane-devel mailing list