public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PATCH RFA: -I existing-file should be a warning, not an error
@ 2009-11-07  7:22 Ian Lance Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2009-11-07  7:22 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 793 bytes --]

> gcc -I some-random-string -c hello.c
=> no output, compilation successful

>  gcc -I hello.c -c hello.c
cc1: error: hello.c: not a directory
=> error message, compilation fails

I noticed this when I happened to create an executable with the same
name as the gcc source directory I was building.  The libgcc build
using -I with a ../.. during the build, and found the executable
rather than the source directory.  It all worked fine after I deleted
the executable.

I see no benefit to making this an error.  I propose the following
patch to make it a warning instead.  Bootstrapped and tested on
i686-unknown-linux-gnu.  OK for mainline?

Ian


2009-11-06  Ian Lance Taylor  <iant@google.com>

	* incpath.c (remove_duplicates): Change "not a directory"
	diagnostic from error to warning.



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: warning --]
[-- Type: text/x-diff, Size: 420 bytes --]

Index: incpath.c
===================================================================
--- incpath.c	(revision 153981)
+++ incpath.c	(working copy)
@@ -239,7 +239,7 @@ remove_duplicates (cpp_reader *pfile, st
 	    }
 	}
       else if (!S_ISDIR (st.st_mode))
-	cpp_error_with_line (pfile, CPP_DL_ERROR, 0, 0,
+	cpp_error_with_line (pfile, CPP_DL_WARNING, 0, 0,
 			     "%s: not a directory", cur->name);
       else
 	{

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-11-07  5:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-07  7:22 PATCH RFA: -I existing-file should be a warning, not an error Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).