On 10/31/2010 6:21 AM, David wrote:
Does Cygwin c compiler not support c99?
or does c99 not support?:
#include <stdio.h>
#include <stdlib.h>
int main(void) {
bool f=true;
for(int i=0; i<10; i++) {
if (f)
printf("%d\n",i);
}
puts("Hello World!!!"); /* prints Hello World!!! */
return EXIT_SUCCESS;
}
Here the bool declaration fails and so do the for statement. The
compiler doesn't like that I use the iteration variable inside the
for-loop.
Neither I nor the compiler see a declaration of bool there. Is this
example what you intended?
After defining bool and true in terms of _Bool
gcc -O -Wall -pedantic -std=c99 djb.c
$ ./a
0
1
2
3
4
5
6
7
8
9
Hello World!!!
--
Tim Prince
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple