This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/27153] function result is dereferenced error
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Apr 2006 02:51:10 -0000
- Subject: [Bug c/27153] function result is dereferenced error
- References: <bug-27153-11015@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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