Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Content-return: allowed Date: Tue, 08 Apr 2003 16:23:52 -0400 From: "Dawson, David W" Subject: RE: ACE/TAO under Cygwin (was: ORB) To: "'cygwin AT cygwin DOT com'" Message-id: <0C73AA5F720CD311AC2A0008C7DBA9B409CDAA93@emss09m13.ems.lmco.com> MIME-version: 1.0 Content-type: text/plain Content-transfer-encoding: 7BIT Tim, Thank you for your input. As I have not been following the development/maturing of the C/C++ language and standards, I was not aware that this was standard/common. This was *exactly* the information I was trying to find out. My problem/encounter with the log2() macro comes from trying to port the ACE environment to Cygwin. As the ACE environment has been ported to *many* different platform OS's (over 40 listed at http://www.cs.wustl.edu/~schmidt/ACE-overview.html ). ACE provides a (properly namespace'd) implementation of log2() without your recommended (required) "#undef log2" included in the class header file. I was hesitant to suggest to the ACE development group that they were in error based solely (it seemed to me) on problems compiling under Cygwin. HOWEVER, armed now with the information at hand, I can perhaps suggest to the ACE development group that such an addition to the header file is in order. Thank you. -David. --------------------- David Dawson david DOT w DOT dawson AT lmco DOT com 703-367-3885 >----- Original Message ----- >From: "Timothy C Prince" >To: >Cc: >Sent: Monday, April 07, 2003 12:36 PM >Subject: Re: RE: ACE/TAO under Cygwin (was: ORB) > > > >Did you forget the usual precautions, when implementing your own version of >a standard intrinsic? > ># undef log2 > >double (log2)(double x){} > >Using a preprocessor macro for log2() is a usual tactic for ia32. It's a >standard function in C99, included in most libraries which implement (even >partly) gcc's c99 support. You __must__ use the #undef if you want a "real" >log2() according to the current standard, whether you provide it yourself, >or hope for the library to have it already (cygwin/newlib doesn't). > >__________________________________________________ >This wouldn't be the first time C99 made an older program questionably >compliant by providing a log2() function in the standard list. I guess >the worst case would be if an exact int result were expected, but the >standard log2() happened to present a result which is slightly smaller. >This shouldn't happen with the glibc macro, because rounding from long >double to double prior to truncating would take care of it. >Tim Prince -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/