Message ID | mcrhbhruimz.fsf@google.com |
---|---|
State | New |
Headers | show |
On Wed, 15 Sep 2010, Ian Lance Taylor wrote: > Back in http://gcc.gnu.org/ml/gcc-patches/1998-11/msg00379.html Zack > added a check to cpplib for whether a name given with -I was a > directory. If it was not, cpplib would issue an error. The old cccp > preprocessor would not issue an error for this case. The error still > exists today. I think it should be a warning rather than an error. If > I write gcc -I include and happen to have a file named "include" rather > than a directory, I don't see any reason for the compilation to fail. > > This patch changes it from an error to a warning. It has been > bootstrapped and tested on x86_64-unknown-linux-gnu. > > OK for mainline? OK.
On 9/15/2010 9:11 AM, Joseph S. Myers wrote: > On Wed, 15 Sep 2010, Ian Lance Taylor wrote: > >> Back in http://gcc.gnu.org/ml/gcc-patches/1998-11/msg00379.html Zack >> added a check to cpplib for whether a name given with -I was a >> directory. >> This patch changes it from an error to a warning. What happens in that case? Do we still keep searching for a directory, or do we stop after giving the warning? I have no opinion; I just wonder if we ought to document whatever it is we do.
Index: incpath.c =================================================================== --- incpath.c (revision 164305) +++ 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 {