This is the mail archive of the gcc-patches@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]

Re: egcs-1.1b, gcc driver



  In message <m3iuicvy2k.fsf@obelix.wegge.dk>you write:
  > --Multipart_Fri_Sep_25_20:36:50_1998-1
  > Content-Type: text/plain; charset=US-ASCII
  > 
  > Hi!
  > 
  >  I recently tried to compile XFree86 with egcs, which unfortunately
  > ended prematurely. The problem I found was that find_a_file() in the
  > gcc driver would happily return a directory name[1]. I'me made a patch
  > that works for me, although it should probably take symbolic links to
  > files into account as well. The patch is attached below.
There are several problems with your patch.

First, you messed up the "access" check.

The test used to look like "access (name, mode) == 0", you changed it to
just "access (name, mode)", which has the opposite meaning.

For the stat call, it's better to use stat (name, &buf) == 0 instead of
!stat (name, &buf).

Instead of writing
	if (cond1 && cond2 &&
	    cond3

Use

	if (cond1
	    && cond2
	    && cond3


Your patch will lose if the file happens to be a symlink as far as I can tell.

Can you fix these problems and resubmit the patch?

Thanks,
jeff


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