From: Nasser Abbasi <nma@12000.org>
Subject: Re: C2Ada port to linux updated.
Date: Tue, 14 Aug 2007 19:14:37 -0700
Date: 2007-08-14T19:14:37-07:00 [thread overview]
Message-ID: <1187144077.372577.38190@e9g2000prf.googlegroups.com> (raw)
In-Reply-To: <lnr6m51x99.fsf@nuthaus.mib.org>
On Aug 14, 5:01 pm, Keith Thompson <ks...@mib.org> wrote:
> Keith Thompson <ks...@mib.org> writes:
> > "Nasser Abbasi" <n...@12000.org> writes:
> > [...]
> >> It took me a day to make it compile/run on Linux. The main problem was with
> >> using _Bool. They added _Bool data type in C99, for some reason ( I am no
> >> gcc expert), the current gcc 4.1 compiler does not have <stdbool.h> and it
> >> does not know about _Bool, and _Bool is used in many places in the code.
> > [...]
>
> > Perhaps you just need to update your gcc. gcc 4.1.1 does support
> > <stdbool.h> and _Bool.
>
> That's odd. I just tried a small test program, and gcc versions 3.2
> and 4.0.0 also support <stdbool.h> and _Bool.
>
> Here's the test case:
>
> #include <stdbool.h>
> _Bool obj1;
> bool obj2;
>
> Save it as, say, "foo.c", feed it to "gcc -c", and see what happens.
> Perhaps your gcc is configured and/or installed incorrectly.
>
> --
> Keith Thompson (The_Other_Keith) ks...@mib.org <http://www.ghoti.net/~kst>
> San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
> "We must do something. This is something. Therefore, we must do this."
> -- Antony Jay and Jonathan Lynn, "Yes Minister"
hi Ken;
Yes, the above works, but the c2ada uses typedefs and it includes
_Bool in there, and that is where the problem occur.
I've just reduced this problem to this simple example to help
illustrate it:
gcc -c il.h
il.h:5: error: expected identifier before '_Bool'
$ cat il.h
#include <stdbool.h>
typedef enum {
_Bool, /* cvt to Boolean, Ada only, unary */
_UnBool, /* cvt bool->int, Ada only, unary */
} node_kind_t;
$ gcc -c -std=c99 il.h
il.h:5: error: expected identifier before '_Bool'
$ gcc -c -ansi il.h
il.h:5: error: expected identifier before '_Bool'
$ gcc -c -std=gnu89 il.h
il.h:5: error: expected identifier before '_Bool'
nabbasi@my-desktop:~/try$ gcc --version
gcc (GCC) 4.1.3 20070403 for GNAT GPL 2007 (20070402)
Could you please try the above on your system? may be my gcc
installation is bad.
I am using Ubuntu
nabbasi@my-desktop:~/try$ uname -a
Linux my-desktop 2.6.20-15-generic #2 SMP Sun Apr 15 07:36:31 UTC 2007
i686 GNU/Linux
Nasser
next prev parent reply other threads:[~2007-08-15 2:14 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-13 10:14 C2Ada port to linux updated Nasser Abbasi
2007-08-14 4:41 ` Jerry
2007-08-14 6:36 ` Nasser Abbasi
2007-08-14 23:47 ` Keith Thompson
2007-08-15 0:01 ` Keith Thompson
2007-08-15 2:14 ` Nasser Abbasi [this message]
2007-08-15 6:40 ` Keith Thompson
2007-08-14 21:05 ` Chip Orange
2007-08-14 23:16 ` Markus E.L. 2
2007-08-24 20:11 ` Chip Orange
2007-08-15 1:15 ` Jeffrey Creem
2007-08-15 9:44 ` Nasser Abbasi
2007-08-16 2:15 ` Jeffrey Creem
2007-08-17 2:15 ` Jeffrey Creem
2007-08-19 23:00 ` Jerry
2007-08-20 12:15 ` Jeffrey Creem
2007-08-15 6:35 ` Martin Krischik
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox