From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13678 invoked by alias); 25 Mar 2014 13:09:27 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 13657 invoked by uid 89); 25 Mar 2014 13:09:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ob0-f179.google.com Received: from mail-ob0-f179.google.com (HELO mail-ob0-f179.google.com) (209.85.214.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 25 Mar 2014 13:09:25 +0000 Received: by mail-ob0-f179.google.com with SMTP id va2so497523obc.38 for ; Tue, 25 Mar 2014 06:09:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=k1CPrKrmOQhKadNOxWgWBuVuPqbhQE9OprmgtDe5DOc=; b=HFw80jDoxabfz9pvmZpcaku4ROHO3Mt9vEGbQaA72a5w4JRO0CvGvS+sfvCDvv4l+v Bv2xc/AKe7xKxQF9iwyBMlN7DdaG2fQlPg6nzWr4vtEZul+lkWpqL1zuLlZ2SrjqL2HS 3lBGNdWoZhs5Oe1dXQbELioIQN5fbzXu4sshiWGR4fbsbJUHrNaDU/kumM+/VLC3pkMU h1U67tG2ueZHitbiNQ99vjPaxh8N3g4j2Os+tL3uHELgv+dUqjURzkVRgyHLFxLeIdEv H8U77LHkqYHlrUiL0J34Tb+wh4LbUvCDQ6bSmZwAwiNo1hkjkxgEiKEFdx91DRPCn5uS FFdQ== X-Gm-Message-State: ALoCoQmWWhLXp3n7B2mVAZGu7usKpPAP4Q/Srf7vKCvSGoRe9fTYosed5m7bu5Jzfi/uuEiH/A11TpRyCi273dVAqkID8SgzgK8Pet9QVC06mCe6tvvzdn/QpqmORLwOhZQy2Wv4ph47WJ9zSohcEfP9ES1N4ovd/4OMFDJxwZs/bA46ZPBwbmZM/1+A+dylIvwmJ2mcTF3o6a6Rca6FwFvg/yngtqnvUg== MIME-Version: 1.0 X-Received: by 10.60.58.234 with SMTP id u10mr720906oeq.72.1395752963358; Tue, 25 Mar 2014 06:09:23 -0700 (PDT) Received: by 10.60.227.226 with HTTP; Tue, 25 Mar 2014 06:09:23 -0700 (PDT) In-Reply-To: <000a01cf4808$67f71ce0$37e556a0$@arm.com> References: <000a01cf4808$67f71ce0$37e556a0$@arm.com> Date: Tue, 25 Mar 2014 13:18:00 -0000 Message-ID: Subject: Re: [patch] Shorten Windows path From: Ian Lance Taylor To: Joey Ye Cc: gcc-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-03/txt/msg01336.txt.bz2 On Tue, Mar 25, 2014 at 1:58 AM, Joey Ye wrote: > Ping This code looks different on mainline. Writing "if ( do_canonical )" is not GCC style. This patch does not respect the configure option --disable-canonical-system-headers. Also I personally don't actually know what the consequences would be. Are there any downsides to canonicalizing header names? Ian >> -----Original Message----- >> From: Joey Ye [mailto:joey.ye@arm.com] >> Sent: 19 February 2014 15:45 >> To: gcc-patches@gcc.gnu.org; Ian Lance Taylor (iant@google.com) >> Subject: [patch] Shorten Windows path >> >> Max length of path on Windows is 255, which is easy to exceed in a >> complicated project. Ultimate solution may be complex but canonizing the >> path and skipping the ".."s in path is helpful. >> >> Relative discussion in gcc-patches: >> http://gcc.gnu.org/ml/gcc-patches/2013-11/msg00582.html >> >> OK to trunk stage 1? >> >> ChangeLog.libcpp: >> * files.c (find_file_in_dir): Always try to shorten for DOS. >> >> diff --git a/libcpp/files.c b/libcpp/files.c index 7e88778..9dcc71f 100644 >> --- a/libcpp/files.c >> +++ b/libcpp/files.c >> @@ -386,9 +386,18 @@ find_file_in_dir (cpp_reader *pfile, _cpp_file *file, >> bool *invalid_pch) >> hashval_t hv; >> char *copy; >> void **pp; >> + bool do_canonical; >> >> +#ifdef HAVE_DOS_BASED_FILE_SYSTEM >> + /* For DOS based file system, we always try to shorten file path >> + * to as it has a shorter constraint on max path length. */ >> + do_canonical = true; >> +#else >> /* We try to canonicalize system headers. */ >> - if (CPP_OPTION (pfile, canonical_system_headers) && > file->dir->sysp) >> + do_canonical = (CPP_OPTION (pfile, canonical_system_headers) >> + && file->dir->sysp); #endif >> + if ( do_canonical ) >> { >> char * canonical_path = maybe_shorter_path (path); >> if (canonical_path) > >