Is it possible to get GCC to read from a pipe?

Yes, but you have to specify the language using the -x option:

# Specify input file as stdin, language as C
flex -t lexer.l | gcc -o lexer.o -xc -

Leave a Comment