c***e 发帖数: 542 | 1 程序需要在runtime生成C code, 但是不能在
硬盘上建立C文件,需要直接将code用某种方法
送给Solaris CC compiler 编译,请问如何让
compiler从pipe或者file stream 读取文件呢? |
c***e 发帖数: 542 | 2 我尝试了在command下如下操作:
>cat dummy.c | CC -o dummy.exe
但是什么也没有产生,也没有任何
message。按理说 CC 应该接受pipe
输入阿。 |
d****p 发帖数: 685 | |
t****t 发帖数: 6806 | 4 usually not. i don't have solaris here, but usually you need additional
options to make cc work with stdin. for one thing, cc will select language
according to file extension; so for gcc, you need either -E (preprocessing
only) or -x (specify language). |
t****t 发帖数: 6806 | 5 and most importantly, according to unix style, you need to specify "-" as
filename to indicate stdin.
【在 t****t 的大作中提到】 : usually not. i don't have solaris here, but usually you need additional : options to make cc work with stdin. for one thing, cc will select language : according to file extension; so for gcc, you need either -E (preprocessing : only) or -x (specify language).
|
T*****9 发帖数: 2484 | 6 用tmpfs
【在 c***e 的大作中提到】 : 程序需要在runtime生成C code, 但是不能在 : 硬盘上建立C文件,需要直接将code用某种方法 : 送给Solaris CC compiler 编译,请问如何让 : compiler从pipe或者file stream 读取文件呢?
|
c***e 发帖数: 542 | 7 specify "-" in gcc works, but cc doesn't.
【在 t****t 的大作中提到】 : and most importantly, according to unix style, you need to specify "-" as : filename to indicate stdin.
|
c***e 发帖数: 542 | 8 what is tmpfs? Could you say more about it? Thanks
【在 T*****9 的大作中提到】 : 用tmpfs
|