On Fri, 14 Nov 2003, Alkis Evlogimenos wrote:> #include "" should only be used when headers are specified using relative > paths. In our case the majority of header inclusions (if not all) use > relative paths so we may want to consider either converting all our #include > "" to #include <> or change header file inclusions to use relative paths. I > don't see any advantages of one over the other but what we have today is not > strictly correct :-)#include <> is for system headers: http://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html#Include%20Syntax While LLVM is slowly moving that direction, we are not yet considered to be required by the "system". -Chris -- http://llvm.cs.uiuc.edu/ http://www.nondot.org/~sabre/Projects/
On Friday 14 November 2003 12:24 pm, Chris Lattner wrote:> On Fri, 14 Nov 2003, Alkis Evlogimenos wrote: > > #include "" should only be used when headers are specified using relative > > paths. In our case the majority of header inclusions (if not all) use > > relative paths so we may want to consider either converting all our > > #include "" to #include <> or change header file inclusions to use > > relative paths. I don't see any advantages of one over the other but what > > we have today is not strictly correct :-) > > #include <> is for system headers: > http://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html#Include%20Syntax > > While LLVM is slowly moving that direction, we are not yet considered to > be required by the "system".Yes they define as "system" headers files that declare interfaces to parts of the OS (cpp info, section Header Files). Of couse what is defined as OS is not mentioned anywhere so you can define that as you like. Personally I believe it is not just the kernel but also all packages installed in standard directories. So what they call "system" headers are basically installed headers and user headers are internal ones. In the context of llvm every header that is under inlcude is a "system" header (because when we write an install target it will end up in /usr/include/llvm) otherwise it is a user header. -- Alkis
> > While LLVM is slowly moving that direction, we are not yet considered to > > be required by the "system". > > Yes they define as "system" headers files that declare interfaces to parts of > the OS (cpp info, section Header Files). Of couse what is defined as OS is > not mentioned anywhere so you can define that as you like. Personally I > believe it is not just the kernel but also all packages installed in standard > directories. So what they call "system" headers are basically installed > headers and user headers are internal ones. In the context of llvm every > header that is under inlcude is a "system" header (because when we write an > install target it will end up in /usr/include/llvm) otherwise it is a user > header.I'm sorry, but at this point I don't see the value of making this change. It would be a lot of work for no clear benefit. Even if/when llvm headers get installed into /usr/include/llvm, you can still use "" to get them. For most practical purposes, all <> vs "" do is change the order of the search path. Am I missing something here, or is this just a matter of a personal preference? -Chris -- http://llvm.cs.uiuc.edu/ http://www.nondot.org/~sabre/Projects/
> So what they call "system" headers are basically installed > headers and user headers are internal ones. In the context of llvm every > header that is under inlcude is a "system" header (because when we write an > install target it will end up in /usr/include/llvm) otherwise it is a user > header.We don't want a user to compile a new copy of LLVM using the headers of a previously-installed version of LLVM. -- gaeke at uiuc.edu