delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/09/22/17:28:31

From: Marc Singer <nbn.nbn.com!sapien!elf>
Subject: Re: Problem
To: nbn.nbn.com!sapien!cs.utk.edu!byers
Date: Fri, 22 Sep 1995 13:22:15 -0700 (PDT)
Cc: nbn.nbn.com!sapien!sun.soe.clarkson.edu!djgpp (DJGPP List Alias)

According to byers AT cs DOT utk DOT edu:
> 
>   I have used GCC for about 4 years on a UNIX machine.  I just installed djgpp
> on my DOS machine.  I started writing a program and in one of my functions,
> I have a series of statements like:
> 
> 	i = 0
> 	while(i < size)
> 	{
> 	  A[i] = pick_random_number();
> 	  if(C[(A[i])] == USED)
> 	     continue;
> 	  else {
> 	     C[(A[i])] = USED;
> 	     ++i;
> 	  }
> 	}

The code fragment is too small to evaluate fairly.  If you can submit
a small program that demonstrates the problem, maybe we can find the
error.  Note that there are no significant differences between a
program compiled for DJGPP and one compiled for UNIX when I/O is
excluded.  It is the compiler that makes a difference in loops and
optimization.  Is you UNIX compiler GNU CC?

----------------------------------------------------------------------
          Marc Singer       | "... but when you eat this ... pear, you
       elf AT netcom DOT com       |  are rarely aware of the fact that it was
   or  elf AT sapien DOT com       |  ... plucked from the branch of this ... 
< My comments are my own. > |  pear tree." -- Charlie Varon

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019