| Summary: | Preprocessor cannot be configured to mimic the behavior effectuated by gcc's -I- option | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Markus Schorn <mschorn.eclipse> |
| Component: | cdt-parser | Assignee: | Markus Schorn <mschorn.eclipse> |
| Status: | RESOLVED FIXED | QA Contact: | Markus Schorn <mschorn.eclipse> |
| Severity: | normal | ||
| Priority: | P3 | CC: | cdtdoug, mober.at+eclipse, yevshif |
| Version: | 8.0 | ||
| Target Milestone: | 8.1.1 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Markus Schorn
CQ:WIND00331981 We have customers who leverage gcc's -I- option in order to "override" one or few of a large System's includes with a locally modified copy. A similar approach is taken by Board Support Packages (BSP's) for embedded OS's, where the BSP's device drivers sometimes need to slightly modify system includes but they can't physically modify those system includes since the BSP is considered an add-on module. So when original includes can't be modified, the only possible workaround is copying all global include to a local shadow, add respective local include paths first and make any modifications there. This makes it hard to track local modifications though, and the effort mainting the copy and ensuring proper include paths throughout the build system is not adequate. I'm aware that gcc's -I- option is deprecated, but I claim that the concept of being able to override global includes by a local copy is still important (and may also be made available by compilers other than gcc). Some evidence that the 'inhibits the use of the directory of the current file directory as the first search directory for #include "file"' aspect is still relevant for large-scale software development, although it is deprecated: ALU nmake needs it, and references other cpp preprocessors that support it http://www.bell-labs.com/project/nmake/newsletters/issue021.html BOOST Wave driver supports it http://www.boost.org/doc/libs/1_49_0/libs/wave/doc/wave_driver.html The essential user story is this: As a software provider, I have to support several (say 30) different versions or branches of my software. I'm maintaining a shared workspace for each stream, which has the current version of all sources and binaries and performs automated nightly builds. As a developer who has to fix an issue, I want to "hook up to" one of those shared workspaces and modify just the files that I have to modify. This "hook up" has to be quick since I need to switch the version I'm working on often during the day. I want to re-use prebuilt binaries from the shared workspace as much as possible: copying the entire workspace is a no-go since it's > 5 Gigabytes each workspace and I cannot afford my 200 developers to copy all stuff all the time; plus, copying an entire tree adds risk with respect to maintaining make dependencies and having incorrect source paths in the ELF files. So I'm using tools like gmake VPATH / nmake viewpathing in order to maintain only a few locally modified files. The gcc '-I-' option is required in this context such that a locally modified headerfile override is properly picked up even if it is included from a parent header that is global. I have enabled suppressing the use of the directory of the current file when the directory '-' is passed as part of the include search path to the preprocessor. Added testcase and fix. *** cdt git genie on behalf of Markus Schorn ***
Bug 369770: Allow suppressing use of directory of current file for resolving includes (effect of option -I-).
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=ecdf231dbc3b3c0f826e12d657855ce006c603ad
*** cdt git genie on behalf of Markus Schorn ***
Bug 369770: Allow suppressing use of directory of current file for resolving includes (effect of option -I-).
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=ee06da3642eb9fd058bfe1649cbefe1a4035d4f1
|