X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: References: <4CCD72FF DOT 1000901 AT aol DOT com> Date: Sun, 31 Oct 2010 14:55:29 +0000 Message-ID: Subject: Re: Cygwin c compiler and c99 From: Andy Koppe To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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 31 October 2010 14:39, David wrote: > By adding #include it worked. > > Den 31-10-2010 14:45, Tim Prince skrev: >> >> On 10/31/2010 6:21 AM, David wrote: >>> >>> Does Cygwin c compiler not support c99? >>> or does c99 not support?: >>> >>> #include >>> #include > > #include >>> >>> 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; >>> } >>> > > > But why do I have to include ? Because 'bool', 'true' and 'false' are not defined in the C99 language, but in the C99 library, as macros in the stdbool.h header. The language only defines the type _Bool with vaues 0 and 1. See also: http://www.codinghorror.com/blog/2008/03/the-first-rule-of-programming-its-always-your-fault.html Andy -- 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