execution out of order ?

James Darrell McCauley jdm5548 at diamond.tamu.edu
Thu Jul 19 14:04:31 AEST 1990


What generally causes instructions to be executed out of order?
This occurred once while over stepping the bounds of an array
(and I assume writing in memory locations where instructions are
stored), but I don't believe that is the case for my current
problem.  Specifically, what would cause the following?

  /* instructions */                   /* script of execution */
  main()                                % gcc main.c
  {                                     % a.out
     ...                                *Christ
     fgetc(stdin);                      *comes
     printf("*Christ\n");               ^M^M
     ...                                *first
     printf("*comes\n");                %
     fgetc(stdin);                      % <bang head against console>
     printf("*first\n");
  }

I get the same results with getchar().
This may be a FAQ and/or reflect my own ignorance, so in an effort to
avoid negative comments, please E-mail any suggestions. Thanks.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
James Darrell McCauley                 jdm5548 at diamond.tamu.edu
Dept of Ag. Engineering                          (409) 845-6484
Texas A&M University, College Station, Texas 77843-2117, USA
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



More information about the Comp.lang.c mailing list