delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/10/31/09:45:53

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
Message-ID: <4CCD72FF.1000901@aol.com>
Date: Sun, 31 Oct 2010 06:45:35 -0700
From: Tim Prince <n8tm AT aol DOT com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Cygwin c compiler and c99
References: <iajqhl$kq7$1 AT dough DOT gmane DOT org>
In-Reply-To: <iajqhl$kq7$1@dough.gmane.org>
x-aol-global-disposition: G
X-AOL-SCOLL-SCORE: 0:2:346665536:93952408
X-AOL-SCOLL-URL_COUNT: 0
x-aol-sid: 3039ac1d29054ccd730032ca
X-AOL-IP: 99.13.231.72
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019