delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/09/15/05:39:08

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_40,SPF_PASS
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
Subject: Cygwin 1.7/1.5 C99 conformance (GCC, libc)
Date: Tue, 15 Sep 2009 11:38:44 +0200
Cc: "Bjorn Reese" <breese AT mail1 DOT stofanet DOT dk>
MIME-Version: 1.0
From: "Matthias Andree" <matthias DOT andree AT gmx DOT de>
Message-ID: <op.u0ak2ujy1e62zd@balu.cs.uni-paderborn.de>
User-Agent: Opera Mail/10.00 (Win32)
X-IsSubscribed: yes
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

Greetings,

I recently figured that ctrio (from sourceforge.net) fails to link (GCC  
3.4.4 here).

Reason is that ctrio checks the __STDC_VERSION__ for C99 support, which  
there is, and assumes that the implementation were a hosted one (as  
opposed to a freestanding one) and uses powl() without further checks.

Now, Cygwin 1.5 and 1.7 appear to lack long double library support in  
libc/libm -- which is required for a hosted C99 implementation however,  
but not for a freestanding C99 implementation.

Trying to solve this, I found another Cygwin issue: GCC 3.4.4 sets  
__STDC_HOSTED__ to 1 by default (that's a GCC factory default).

I propose that this gets overridden to 0 in Cygwin-ported GCC compilers  
until the library support for a C99-conforming full hosted implementation  
is in place, so that applications can safely check

#if __STDC_HOSTED__ - 0 > 0
/* assume hosted C99 implementation, i. e. with powl() capable libc/libm */
/* ... */
#endif

Thanks.

Best regards

-- 
Matthias Andree

--
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