[bitc-dev] Trying hello world in BitC
Pierre THIERRY
nowhere.man at levallois.eu.org
Sun Mar 16 13:51:21 EDT 2008
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
--
nowhere.man at levallois.eu.org
OpenPGP 0xD9D50D8A
-------------- next part --------------
A non-text attachment was scrubbed...
Name: c99.diff
Type: text/x-diff
Size: 659 bytes
Desc: not available
Url : http://www.coyotos.org/pipermail/bitc-dev/attachments/20080316/5b6fa00f/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: endl.diff
Type: text/x-diff
Size: 713 bytes
Desc: not available
Url : http://www.coyotos.org/pipermail/bitc-dev/attachments/20080316/5b6fa00f/attachment-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.coyotos.org/pipermail/bitc-dev/attachments/20080316/5b6fa00f/attachment-0002.bin
More information about the bitc-dev
mailing list