Hello.
> On Fri, 2009-08-28 at 10:29 +0200, Benjamin Monate wrote:
>> AFAIU if p==&a then
>> a=++(*p) ;
>> is the same as
>> a=++a;
>> which is undefined as it has two effects on "a" between two sequence points.
>
> The example had p==&p, not p==&a. a=++(*p) doesn't have two effects on
> 'a'---it
On Fri, 2009-08-28 at 10:29 +0200, Benjamin Monate wrote:
> AFAIU if p==&a then
> a=++(*p) ;
> is the same as
> a=++a;
> which is undefined as it has two effects on "a" between two sequence points.
The example had p==&p, not p==&a. a=++(*p) doesn't have two effects on
'a'---it has one on 'a' and o
Gabriel Kerneis a écrit :
> Since you seem to have mastered the Standard far beyond what I managed,
> would you mind explaining why the behavior is indeed undefined in the
> cases discussed above? I read the relevant sections over and over for
> at least an hour and couldn't be convinced by either
John -
On Thu, Aug 27, 2009 at 04:59:45PM -0600, John Regehr wrote:
> >unsigned long a;
> >unsigned long *p;
> >p = (unsigned long *)&p;
> >a = ++(*p);
>
> Gabriel, since p refers to itself this code looks to me like an
> occurrence of the second clause of this type of undefined be