This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/10069: -include switch is improperly handled
Sean McNeil wrote:-
> No, I am not using PCH. I'm trying to use the --include switch but it
> isn't recognized by C++ as a switch with 2 arguments and so it gets
> improperly handled. It ends up reordering my switches and passes -O2 as
> the file to include and tries to compile the include file as an input
> file.
By "C++" do you mean the g++ driver? That may well be a bug. If so,
the place to look is cp/lang-specs.h.
> So I observed that
>
> gcc -include hack.h -O2 test.cc
>
> would end up as
>
> switches:
> -include -O2
>
> input files:
> hack.h test.cc
>
> thus it would fail because it cannot find the file "-O2" and because it
> would precompile hack.h into hack.pch.
LOL. Though if you're not using PCH I don't understand your comment.
Neil.