This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc for syntax check only (C): need to read source from stdin
Zack,
Now this works. Thanks a lot.
And with -pipe, no temporary files at all (checked -v output).
Could this be possibly placed in some FAQ? I tried to google for this
first but did not get such a definitive (and simple) answer.
On 4/12/05, Zack Weinberg <zack@codesourcery.com> wrote:
> In order to run the compiler as well, you have to tell it what
> language it's getting, e.g.
>
> $ cat a.c | gcc -x c -fsyntax-only -
>
> Normally this is determined from the file extension, but that's not
> available when reading stdin. It doesn't matter (much) when running
> the preprocessor, which is why it lets you do that without the -x c.
>
> zw
>
--
Dimitry Golubovsky
Anywhere on the Web