Dirafter was probably just a mistake. Gcc uses -idirafter. Signed-off-by: Alexey zaytsev <alexey.zaytsev@xxxxxxxxx> --- lib.c | 15 +++++---------- pre-process.c | 4 ++-- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/lib.c b/lib.c index b579834..7adff2d 100644 --- a/lib.c +++ b/lib.c @@ -313,6 +313,11 @@ static char **handle_switch_i(char *arg, char **next) if (!path) die("missing argument for -isystem option"); add_pre_buffer("#add_isystem \"%s/\"\n", path); + } else if (*next && !strcmp(arg, "idirafter")) { + char *path = *++next; + if (!path) + die("missing argument for -idirafter option"); + add_pre_buffer("#add_dirafter \"%s/\"\n", path); } return next; } @@ -573,15 +578,6 @@ static char **handle_nostdinc(char *arg, char **next) return next; } -static char **handle_dirafter(char *arg, char **next) -{ - char *path = *++next; - if (!path) - die("missing argument for -dirafter option"); - add_pre_buffer("#add_dirafter \"%s/\"\n", path); - return next; -} - static char **handle_base_dir(char *arg, char **next) { gcc_base_dir = *++next; @@ -599,7 +595,6 @@ char **handle_switch(char *arg, char **next) { static struct switches cmd[] = { { "nostdinc", handle_nostdinc }, - { "dirafter", handle_dirafter }, { "gcc-base-dir", handle_base_dir}, { NULL, NULL } }; diff --git a/pre-process.c b/pre-process.c index 9c6ef5b..cf53893 100644 --- a/pre-process.c +++ b/pre-process.c @@ -682,10 +682,10 @@ static int already_tokenized(const char *path) * angle_includepath is set equal to isys_includepath. * -nostdinc removes all sys dirs by storing NULL in entry pointed * to by * sys_includepath. Note that this will reset all dirs built-in - * and added before -nostdinc by -isystem and -dirafter. + * and added before -nostdinc by -isystem and -idirafter. * -isystem dir adds dir where isys_includepath points adding this dir as * first systemdir - * -dirafter dir adds dir to the end of the list + * -idirafter dir adds dir to the end of the list */ static void set_stream_include_path(struct stream *stream) -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html