This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/27153] function result is dereferenced error



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]