--- Comment #13 from joseph at codesourcery dot com 2006-04-18 12:57
---
Subject: Re: function result is dereferenced error
On Tue, 18 Apr 2006, falk at debian dot org wrote:
> > However, the evaluation of the
> > arguments to printf may overlap and the order is unspecified, so ther
On Tue, 18 Apr 2006, falk at debian dot org wrote:
> > However, the evaluation of the
> > arguments to printf may overlap and the order is unspecified, so there are
> > many possible outputs from the program (but "3 2 1" and "3 1 1", for
> > example, are not possible).
>
> I don't understand w
--- Comment #12 from falk at debian dot org 2006-04-18 12:37 ---
(In reply to comment #11)
> No, this testcase is unspecified, not undefined. There are intervening
> sequence points at the start and end of each call to function
OK.
> However, the evaluation of the
> arguments to pri
--- Comment #11 from joseph at codesourcery dot com 2006-04-18 11:17
---
Subject: Re: function result is dereferenced error
On Tue, 18 Apr 2006, falk at debian dot org wrote:
> Uhm, this has nothing to do at all with evaluation order. Evaluation
> order of arguments is unspecified (n
--- Comment #10 from falk at debian dot org 2006-04-18 06:27 ---
Uhm, this has nothing to do at all with evaluation order. Evaluation
order of arguments is unspecified (not undefined, which wouldn't make a
lot of sense), but that is in fact irrelevant here, it could lead to,
say, 3 1 2,
--- Comment #9 from bangerth at dealii dot org 2006-04-18 03:21 ---
> It does not matter either. The evaluation of a function argument is an atomic
> procedure.
No, it actually isn't.
> If it starts it should generate a result. Isn't it strange if the
> compiler evaluates a little bi
--- Comment #8 from pinskia at gcc dot gnu dot org 2006-04-18 00:21 ---
(In reply to comment #7)
> (In reply to comment #6)
> > In C, there is no ordering left to right, please go read the C FAQ at:
> > http://www.eskimo.com/~scs/c-faq.com/expr/index.html
> > subpage:
> > http://www.eski
--- Comment #7 from alexey at cs dot sunysb dot edu 2006-04-18 00:06
---
(In reply to comment #6)
> In C, there is no ordering left to right, please go read the C FAQ at:
> http://www.eskimo.com/~scs/c-faq.com/expr/index.html
> subpage:
> http://www.eskimo.com/~scs/c-faq.com/expr/comma.
--- Comment #6 from pinskia at gcc dot gnu dot org 2006-04-14 16:54 ---
In C, there is no ordering left to right, please go read the C FAQ at:
http://www.eskimo.com/~scs/c-faq.com/expr/index.html
subpage:
http://www.eskimo.com/~scs/c-faq.com/expr/comma.html
This page answers your questi
--- Comment #5 from alexey at cs dot sunysb dot edu 2006-04-14 03:06
---
> > > It is undefined on which function call is done in what order
> > It does not matter in this example.
> Why do you think that?
Because the result is "x x x" for all orders instead of 1 2 3.
> int *a, *b, *c;
--- Comment #4 from pinskia at gcc dot gnu dot org 2006-04-14 02:55 ---
(In reply to comment #2)
> It does not matter either. The evaluation of a function argument is an atomic
> procedure. If it starts it should generate a result. Isn't it strange if the
> compiler evaluates a little bi
--- Comment #3 from pinskia at gcc dot gnu dot org 2006-04-14 02:50 ---
(In reply to comment #2)
> > It is undefined on which function call is done in what order
>
> It does not matter in this example.
>
Why do you think that?
It does generate a call to func but not as you expected i
--- Comment #2 from alexey at cs dot sunysb dot edu 2006-04-14 02:46
---
> It is undefined on which function call is done in what order
It does not matter in this example.
> and also were the
> dereferencing is done, before or after the next function call.
It does not matter either.
--- Comment #1 from pinskia at gcc dot gnu dot org 2006-04-14 02:31 ---
It is undefined on which function call is done in what order and also were the
dereferencing is done, before or after the next function call.
*** This bug has been marked as a duplicate of 11751 ***
--
pinskia a
14 matches
Mail list logo