Scribit Swaroop Sridhar dies 16/03/2008 hora 12:21:
> A top-level form in BitC must be a defining form. That is, one of
> define, defstruct, defunion, defrepr, deftypeclass, definstance.
> 
> The parser is looking for one of these keywords, to begin a top-level
> form, which is why you are getting a syntax error after the end of the
> first word.

I would be useful to get a more verbose error.

> There is an example of Hello World program in the test cases:
> src/bitcc-bootstrap/tests/unit/hello.bitc

There remain a single problem:

$ ./bitcc -I../include -L../lib -l obj hello.bitc
gcc -O2  -I ../include -L ../lib -o bitc.out bitc.out.c -lbitc -lgcDans le 
fichier inclus à partir de bitc.out.c:8:
../include/bitc/runtime.h:49:2: erreur: #error "bitcc output requires C99 
support"

I had to manually tell GCC which standard I want:

$ gcc -O2  -I ../include -L ../lib -o bitc.out bitc.out.c -lbitc -lgc --std=c99

No error. Fantastic! And it runs, too:

$ ./bitc.out
Hello, world!

The attached one-line patch seems to fix this. The second one is a
convenience: it adds an EOL after the output of GCC's invocation on
stderr.

Quickly,
Pierre
-- 
[EMAIL PROTECTED]
OpenPGP 0xD9D50D8A
# HG changeset patch
# User Pierre THIERRY <[EMAIL PROTECTED]>
# Date 1205689422 -3600
# Node ID 073b8ebe537aa5af588a84853735e51815b7d1bb
# Parent  4b63c8c09cb047effa34c7ed308fe9284cced601
Added C99 language standard to GCC invocation

diff -r 4b63c8c09cb0 -r 073b8ebe537a src/bitcc-bootstrap/frontend/gen-c.cxx
--- a/src/bitcc-bootstrap/frontend/gen-c.cxx	Wed Mar 12 17:02:17 2008 -0400
+++ b/src/bitcc-bootstrap/frontend/gen-c.cxx	Sun Mar 16 18:43:42 2008 +0100
@@ -3000,6 +3000,7 @@ EmitObj(std::ostream &optStream, std::os
   opt << " bitc.out.c";
   opt << " -lbitc";
   opt << " -lgc";
+  opt << " --std=c99";
 
   std::cerr  << opt.str();
 
# HG changeset patch
# User Pierre THIERRY <[EMAIL PROTECTED]>
# Date 1205689509 -3600
# Node ID bfd94d20f4ac3224c99adeba4fe5a8bd6021bbce
# Parent  073b8ebe537aa5af588a84853735e51815b7d1bb
Added endline after GCC invocation output

diff -r 073b8ebe537a -r bfd94d20f4ac src/bitcc-bootstrap/frontend/gen-c.cxx
--- a/src/bitcc-bootstrap/frontend/gen-c.cxx	Sun Mar 16 18:43:42 2008 +0100
+++ b/src/bitcc-bootstrap/frontend/gen-c.cxx	Sun Mar 16 18:45:09 2008 +0100
@@ -3002,7 +3002,7 @@ EmitObj(std::ostream &optStream, std::os
   opt << " -lgc";
   opt << " --std=c99";
 
-  std::cerr  << opt.str();
+  std::cerr  << opt.str() << std::endl;
 
   system(opt.str().c_str());
   //system("rm -f bitc.out.c");

Attachment: signature.asc
Description: Digital signature

_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to