Making gcc read from the standard input

Mike Stump mrs@apple.com
Thu Jan 11 17:06:00 GMT 2007


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.



More information about the Gcc-help mailing list