From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28632 invoked by alias); 27 Jul 2014 17:48:55 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 28597 invoked by uid 48); 27 Jul 2014 17:48:52 -0000 From: "ilya.konstantinov at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/61922] Recursive #include overruns Win32 MAX_PATH due to lack of path canonization Date: Sun, 27 Jul 2014 17:48:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: preprocessor X-Bugzilla-Version: 4.8.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ilya.konstantinov at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-07/txt/msg01773.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61922 --- Comment #3 from Ilya Konstantinov --- Both mingw and cygwin will eventually call CreateFile, there's no way around that. The 260 characters limitation is on CreateFile. Re symlinks - see discussion on the llvm issue. I'm not proposing textual canonization since it will not respect symlinks. However, applying GetFullPathName each time will be much better than the current state. Here's an example: > cd c:\dev\test\ > gcc test.c test.c: #include "foo/foo.h" BEFORE: CreateFile("foo/foo.h") AFTER: GetFullPathName("foo/foo.h") --> CreateFile("c:\dev\foo\foo.h) foo\foo.h: #include "../bar/bar.h" BEFORE: CreateFile("foo/../bar/foo.h") AFTER: GetFullPathName("c:\dev\foo\../bar/bar.h") --> CreateFile("c:\dev\bar\bar.h) bar\bar.h: #include "../baz/baz.h" BEFORE: CreateFile("foo/../bar/../baz/baz.h") AFTER: GetFullPathName("c:\dev\bar\../baz/baz.h") --> CreateFile("c:\dev\baz\baz.h)