[LLVMbugs] [Bug 11097] New: NumQuoted wrong after RemoveDuplicates(SearchList, NumQuoted, Verbose);

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Oct 9 20:00:46 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=11097

           Summary: NumQuoted wrong after RemoveDuplicates(SearchList,
                    NumQuoted, Verbose);
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Headers
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: emmanuel.christophe at gmail.com
                CC: llvmbugs at cs.uiuc.edu


In InitHeaderSearch.cpp in the Realize() method during the third call
to RemoveDuplicates:

01092   // Remove duplicates across both the Angled and System
directories.  GCC does
01093   // this and failing to remove duplicates across these two groups breaks
01094   // #include_next.
01095   RemoveDuplicates(SearchList, NumQuoted, Verbose);

The RemoveDuplicates method can remove non system directories (when
they are also system directories) showing the information message:

01039       if (DirToRemove != i)
01040         llvm::errs() << "  as it is a non-system directory that
duplicates "
01041                      << "a system directory\n";

When this happens, the NumQuoted variable is wrong, the header
initialization is incorrect:
01098   Headers.SetSearchPaths(SearchList, NumQuoted, NumAngled,
DontSearchCurDir);

and the use of  search_dir_iterator system_dir_begin() is unreliable,
missing some system directories.

This bug manifested itself using include-what-you-use, misinterpreting some
system path as user path:
http://code.google.com/p/include-what-you-use/issues/detail?id=60

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list