the best thing you could do is just

        rm inc1.h

and then use -Iplan9.  a more plan 9 like solution is to do one of

        bind plan9/inc1.h inc1.h
        bind -b plan9 .

but both of those are likely to confuse things in the future.

it turns out, accidentally i am sure, that you can also

        chmod 0 inc1.h

and then cpp will not be able to read it and it will move 
on to plan9/inc1.h.

> cc/lex.c:51 includes the current directory to be first in the include
> search path.  i think the loop at lex.c:237 should start with index 1,
> not zero, so as not to confuse pcc, i.e.
> 
>                       for(c = 0; c < ninclude; c++) {
>                               sprint(opt, "-I%s", include[c]);
>                               av[i++] = strdup(opt);
>                       }
> 
> should become
> 
>                       for(c = 1; c < ninclude; c++) {
>                               sprint(opt, "-I%s", include[c]);
>                               av[i++] = strdup(opt);
>                       }
> 
> doing includes like you are is not quite the plan 9 style, but the point
> of pcc is to accomidate.

this will have no effect.
it will stop passing -I. to cpp,
but cpp already searches . first no matter what its options are.

#include <foo.h> means find foo.h in the -I directories or else in a standard 
directory.
#include "foo.h" means find foo.h in the current directory or else like <foo.h>

these rules are not specified by ansi, but it's what other unix compilers do 
too.

russ

Reply via email to