From patchwork Wed Sep 15 15:32:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 64836 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 585D2B6EEF for ; Thu, 16 Sep 2010 01:33:16 +1000 (EST) Received: (qmail 2800 invoked by alias); 15 Sep 2010 15:33:12 -0000 Received: (qmail 2735 invoked by uid 22791); 15 Sep 2010 15:33:11 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 15 Sep 2010 15:33:01 +0000 Received: from hpaq5.eem.corp.google.com (hpaq5.eem.corp.google.com [172.25.149.5]) by smtp-out.google.com with ESMTP id o8FFWwL5001970 for ; Wed, 15 Sep 2010 08:32:58 -0700 Received: from pxi10 (pxi10.prod.google.com [10.243.27.10]) by hpaq5.eem.corp.google.com with ESMTP id o8FFWuvJ005860 for ; Wed, 15 Sep 2010 08:32:57 -0700 Received: by pxi10 with SMTP id 10so87687pxi.5 for ; Wed, 15 Sep 2010 08:32:56 -0700 (PDT) Received: by 10.114.76.3 with SMTP id y3mr1973470waa.143.1284564775794; Wed, 15 Sep 2010 08:32:55 -0700 (PDT) Received: from coign.google.com (dhcp-172-22-123-203.mtv.corp.google.com [172.22.123.203]) by mx.google.com with ESMTPS id c24sm2562958wam.19.2010.09.15.08.32.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 15 Sep 2010 08:32:54 -0700 (PDT) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org Subject: Patch RFA: Don't make -I filename be an error Date: Wed, 15 Sep 2010 08:32:52 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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? Ian 2010-09-15 Ian Lance Taylor * incpath.c (remove_duplicates): If name is not a directory, issue a warning rather than an error. 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 {