[Bug c/27153] function result is dereferenced error
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Apr 14 02:51:00 GMT 2006
------- 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 it.
Anyways the way GCC is compiling your code is the following which is valid
under the standard:
int *a, *b, *c;
c = func(3);
b = func(2);
a = func(1);
printf("%d %d %d\n", *(a), *(b), *(c));
so the order is still undefined as there is no sequence point between the
function calls.
*** This bug has been marked as a duplicate of 11751 ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27153
More information about the Gcc-bugs
mailing list