This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Making gcc read from the standard input
- From: Mike Stump <mrs at apple dot com>
- To: Tathagato Rai Dastidar <Tathagato dot Rai dot Dastidar at nsc dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 11 Jan 2007 09:06:37 -0800
- Subject: Re: Making gcc read from the standard input
- References: <45A5D958.50100@nsc.com>
On Jan 10, 2007, at 10:29 PM, Tathagato Rai Dastidar wrote:
Is there a way I can make GCC read a C or C++ code from the
standard input instead of from a file?
$ echo 'int i;' | gcc -S -xc - -o -
.comm _i,16
.subsections_via_symbols
Also, some systems have things like /dev/fd0 and /dev/stdin. They
are files that can be read, even if gcc didn't support the "-" filename.