pardo@uw-june.UUCP (David Keppel) (12/30/87)
I have the following: /* ---- */ typedef int foo; { foo *a, *b, *c; a = b + c; b += c if ((c += a) != b) { a = b; } } /* ---- */ Pcc complains about *every* operator excpet the last "=" (yes, even "!="). I would like to know: why? how can I make it work? (yes, I really want to do "b+=c") how can I make it work without doing "((int) b) += (int) c"? is this a feature? (lint doesn't tell me anything more useful) If this has been around the net before, please reply directly to me. ;-D on (How about *structure* arithmatic ?-) Pardo ucbvax!uw-beaver!uw-june!pardo pardo@cs.washington.edu
chris@mimsy.UUCP (Chris Torek) (12/30/87)
In article <3899@uw-june.UUCP>, pardo@uw-june.UUCP (David Keppel) writes: >typedef int foo; [...] > foo *a, *b, *c; > a = b + c; > b += c > if ((c += a) != b) > a = b; > >Pcc complains about *every* operator excpet the last "=" (yes, even "!="). It complains about the `!=' because you confused with with the `+=' (it lost the type of c). >I would like to know: > why? Because it is meaningless to add two pointers. > how can I make it work? (yes, I really want to do "b+=c") What do you expect to happen? > how can I make it work without doing "((int) b) += (int) c"? That depends on what you want done. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris