[cfe-dev] -isysroot fun

Chris Lattner clattner at apple.com
Wed Jan 30 15:35:41 PST 2008


Steve recently noticed that "clang -isystem . foo.c" doesn't work.   
Clang ends up trying to search "/." instead of "." due to the code in  
clang.cpp:AddPath.

   // Handle isysroot.
   if (Group == System) {
..
     if (isysroot.size() != 1 || isysroot[0] != '/') // Add isysroot  
if present.
       MappedPath.append(isysroot.begin(), isysroot.end());
..
     if (Path[0] != '/')  // If in the system group, add a /.
       MappedPath.push_back('/');
   }

We don't have an isysroot in this case, and Path[0] is '.', not /.   
Should the second if just be dropped?

-Chris




More information about the cfe-dev mailing list