[Chicken-users] Compiling with --std=c99 supported?

2013-09-08 Thread Kristian Lein-Mathisen
Hi there,

I came across something I think might be a bug. While I don't have a deep
understanding of what c99 and gnu99 really mean, I noted that this happens
on my 64bit system:

$ chicken -version
(c) 2008-2013, The Chicken Team
(c) 2000-2007, Felix L. Winkelmann
Version 4.8.0.4 (stability/4.8.0) (rev 578619b)
linux-unix-gnu-x86-64 [ 64bit manyargs dload ptables ]
compiled 2013-07-15 on aeryn.xorinia.dim (Darwin)
$ cat c99test.scm
(print hi)
$ # gnu99 works:
$ csc -C --std=gnu99 c99test.scm  ./c99test
hi
$ # c99 does not work:
$ csc -C --std=c99 c99test.scm  ./c99test
In file included from c99test.c:11:0:
/usr/include/chicken/chicken.h:1532:1: error: unknown type name ‘sigjmp_buf’
 C_varextern C_TLS sigjmp_buf C_restart;
 ^

Error: shell command terminated with non-zero exit status 256: gcc
c99test.c -o c99test.o -c  -fno-strict-aliasing -fwrapv
-DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -Os -fomit-frame-pointer
--std=c99 -I/usr/include/chicken


Is chicken supposed to be compilable with c99?
Thanks,
K.
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Compiling with --std=c99 supported?

2013-09-08 Thread Peter Bex
On Sun, Sep 08, 2013 at 11:52:01PM +0200, Kristian Lein-Mathisen wrote:
 Hi there,
 
 I came across something I think might be a bug. While I don't have a deep
 understanding of what c99 and gnu99 really mean, I noted that this happens
 on my 64bit system:
 
 $ csc -C --std=c99 c99test.scm  ./c99test
 In file included from c99test.c:11:0:
 /usr/include/chicken/chicken.h:1532:1: error: unknown type name ‘sigjmp_buf’
  C_varextern C_TLS sigjmp_buf C_restart;
  ^
 
 Error: shell command terminated with non-zero exit status 256: gcc
 c99test.c -o c99test.o -c  -fno-strict-aliasing -fwrapv
 -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -Os -fomit-frame-pointer
 --std=c99 -I/usr/include/chicken
 
 Is chicken supposed to be compilable with c99?

I'm afraid those options are like the retarded -ansi option, which
utterly disables any POSIX extensions, accepting only vanilla ANSI C
code.  And indeed, the docs for -ansi say in C mode, this is equivalent
to --std=c90.

IIRC, the way to make this work again is to selectively re-enable POSIX
extensions by passing some flags like -DPOSIX and such.

If you can, try to avoid these options unless you're prepared to dig
deep into compatibility differences.

Cheers,
Peter
-- 
http://www.more-magic.net

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Compiling with --std=c99 supported?

2013-09-08 Thread Kristian Lein-Mathisen
Ok, I will rewrite my C-code so I don't have to use either of those flags.
Thanks Peter!

K.


On Sun, Sep 8, 2013 at 11:59 PM, Peter Bex peter@xs4all.nl wrote:

 On Sun, Sep 08, 2013 at 11:52:01PM +0200, Kristian Lein-Mathisen wrote:
  Hi there,
 
  I came across something I think might be a bug. While I don't have a deep
  understanding of what c99 and gnu99 really mean, I noted that this
 happens
  on my 64bit system:
 
  $ csc -C --std=c99 c99test.scm  ./c99test
  In file included from c99test.c:11:0:
  /usr/include/chicken/chicken.h:1532:1: error: unknown type name
 ‘sigjmp_buf’
   C_varextern C_TLS sigjmp_buf C_restart;
   ^
 
  Error: shell command terminated with non-zero exit status 256: gcc
  c99test.c -o c99test.o -c  -fno-strict-aliasing -fwrapv
  -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -Os -fomit-frame-pointer
  --std=c99 -I/usr/include/chicken
 
  Is chicken supposed to be compilable with c99?

 I'm afraid those options are like the retarded -ansi option, which
 utterly disables any POSIX extensions, accepting only vanilla ANSI C
 code.  And indeed, the docs for -ansi say in C mode, this is equivalent
 to --std=c90.

 IIRC, the way to make this work again is to selectively re-enable POSIX
 extensions by passing some flags like -DPOSIX and such.

 If you can, try to avoid these options unless you're prepared to dig
 deep into compatibility differences.

 Cheers,
 Peter
 --
 http://www.more-magic.net

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users