* Cygwin 1.7/1.5 C99 conformance (GCC, libc)
@ 2009-09-15 9:39 Matthias Andree
2009-09-16 10:17 ` Dave Korn
0 siblings, 1 reply; 2+ messages in thread
From: Matthias Andree @ 2009-09-15 9:39 UTC (permalink / raw)
To: cygwin; +Cc: Bjorn Reese
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Cygwin 1.7/1.5 C99 conformance (GCC, libc)
2009-09-15 9:39 Cygwin 1.7/1.5 C99 conformance (GCC, libc) Matthias Andree
@ 2009-09-16 10:17 ` Dave Korn
0 siblings, 0 replies; 2+ messages in thread
From: Dave Korn @ 2009-09-16 10:17 UTC (permalink / raw)
To: cygwin
Matthias Andree wrote:
> 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).
Just FTR, Cygwin-1.5 and gcc-3.4.4 are end-of-life and will never be updated
again.
> 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
Sorry, I don't think that's a good idea. There are a whole world of other
differences implied by the freestanding-vs-hosted distinction that I think it
would not be wise for the compiler to lie about. It is indeed unfortunate
that our C library support (which derives from newlib) is incomplete, and this
gap between theory and practice is what autoconf was invented to bridge.
(Autoconf is of course a compromise born of necessity which in an ideal world
wouldn't exist. But at least it means these problems can be dealt with in a
practical and systematic fashion.)
It mightn't be too hard to get long double support into newlib, but it's all
a matter of someone having the time and wherewithal to actually do it.
cheers,
DaveK
--
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-09-16 10:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-15 9:39 Cygwin 1.7/1.5 C99 conformance (GCC, libc) Matthias Andree
2009-09-16 10:17 ` Dave Korn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).