wgtcc icon indicating copy to clipboard operation
wgtcc copied to clipboard

无法同时处理多个文件

Open huangguiyang opened this issue 8 years ago • 8 comments

for example: wgtcc -S 1.c 2.c

huangguiyang avatar Nov 30 '16 10:11 huangguiyang

yes, it is. Once upon a time, it supported multiple files. I disabled it(the code is simplified also) for convenience of debugging, i will reenable it later.

(ps: we better in English because i occasionally found that there are some foreigners looking at this repo :)

There is another friend that is working on an interesting compiler project https://github.com/thinkermao/LL-Script, a small interpreted language.

wgtdkp avatar Nov 30 '16 12:11 wgtdkp

wgtcc是单进程程序吧?而且遇到错误就退出了,因此是如何支持处理多个文件的呢?第一个文件语法错误导致进程退出,这样第二个文件不就没被处理了么?

huangguiyang avatar Nov 30 '16 17:11 huangguiyang

A single source file is a translation unit.Which means we could fork(),so every child process handle a source file :)

wgtdkp avatar Dec 01 '16 00:12 wgtdkp

这样不好迁移到windows了,因为windows创建子进程要用文件,如果用一个函数的话,只能通过windows的POSIX子系统,然而这个子系统已经不维护了 :) 最开始我为了简单起见,也是单个二进制+fork,迁移到windows发现不大好了

huangguiyang avatar Dec 01 '16 00:12 huangguiyang

We'd better talk in QQ. Can you send your QQ to my email? Thx.

huangguiyang avatar Dec 01 '16 00:12 huangguiyang

Yeah, my pleasure~~

wgtdkp avatar Dec 01 '16 01:12 wgtdkp

But, where do i get your email? :)

wgtdkp avatar Dec 01 '16 01:12 wgtdkp

I've updated my github profile :->

huangguiyang avatar Dec 01 '16 01:12 huangguiyang