Re: reading from stdin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



----- Original Message -----
From: "Ian Lance Taylor" <ian@xxxxxxxx>
To: "Erik Leunissen" <e.leunissen@xxxxxxxxx>
Subject: Re: reading from stdin
Date: 02 Sep 2005 09:39:25 -0700

> 
> Erik Leunissen <e.leunissen@xxxxxxxxx> writes:
> 
> > I would like to compile C code by feeding it to gcc (or cc) from
> > stdin, instead of specifying an input file. What I want would result
> > in a command line like:
> >
> >      echo "ThisWouldNeedToBeCcode" | gcc -o out.o
> 
> In gcc 4 you can do this:
>      echo 'int main() { printf ("Hello, world\n"); }' | gcc -xc - -o out
> 
> The '-' tells gcc to read stdin.  The '-xc' tells gcc that the input
> is in C (rather than, say, C++).
> 
> Ian
I can do that in 3.4.4-1 on cygwin of regular pc

-- 
_______________________________________________

Search for businesses by name, location, or phone number.  -Lycos Yellow Pages

http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux