On Mon, Jan 17, 2005 at 11:45:25AM -0800, Linus Torvalds wrote:
> Why not just have the "system directories start here" pointer, and reverse
> the meaning of it (right now sparse puts them _first_ in the list, not
> last)? Then:
>
> - always put the "" paths first (put the "current .c directory" and "."
> very first), make "angle_includepaths" point past them (replace
> "gcc_includepath" with renamed "angle_includepath".
I messed something up here. "." is actually "current .c directory".
>
> - -I- removes the "current .c directory" entry, which is easy to test
> for: it would be the first one, except if the first one is "."
So this becomes a '++' except that we must support if specified twice.
> This means that "userlim" is not needed
>
> - "add_include" always checks whether it existed already, and does
> nothing if it did (regardless of whether the thing is added to the end
> or to the middle of the list).
>
> This means that "userdir" is not needed.
>
> - "-isystemdir" always adds to the end of the list (no need to mark them
> "systemdir" either)
>
> - "-I" always adds to _before_ the "sys_includepath" marker.
>
> Then at lookup you just do:
>
> - if it uses "", start at the beginning
> - if it uses <>, start at "angle_includepath"
> - if it uses "include_next", start at the previous include-path entry
>
> so at least the lookup is always a total no-brainer, and has no special
> cases at all, and all the special cases would be at "insert into path"
> time.
Looks sane - I will try that out. The angle_includepath did the trick.
Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html