This is the mail archive of the mailing list for the newlib project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [libcxx+newlib] nexttoward{f,l,} shims for _LDBL_EQ_DBL systems

Drop the FORCE_EVAL macro, and wrap nexttowardf in _LDBL_EQ_DBL as per Craig's suggestion.


On 12/9/14 4:36 PM, Jeff Johnston wrote:
----- Original Message -----
From: "Jonathan Roelofs" <>
To: "Jeff Johnston" <>
Cc: "JF Bastien" <>, "Craig Howland" <>,
Sent: Tuesday, December 9, 2014 5:38:40 PM
Subject: Re: [libcxx+newlib] nexttoward{f,l,} shims for _LDBL_EQ_DBL systems

On 12/9/14 3:15 PM, Jeff Johnston wrote:
Just a couple comments.

1. The FORCE_EVAL macro looks for
double or long double, even though it is only used for floats in
By any chance was this macro in a header that you brought into
the code and if so, would it not be better to put the general-purpose
macro in local.h?  Otherwise, I would just suggest removing the double/long
parts that are extraneous in this instance and clutter the code.
FORCE_EVAL did come from a header, and yeah, local.h probably is a better
for it.

If you took it from a header, please confirm the license was the same as
nexttowardf() which is fine btw for inclusion into newlib.
That header has this at the top of it:

   * ====================================================
   * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
   * Developed at SunPro, a Sun Microsystems, Inc. business.
   * Permission to use, copy, modify, and distribute this
   * software is freely granted, provided that this notice
   * is preserved.
   * ====================================================

In that case, just do the volatile assignment manually instead of adding a
second license.

2. You have put the nexttowardf function prototype in the math.h section
_LDBL_EQ_DOUBLE is true but the code itself doesn't use the flag as
it doesn't rely on long double internals.
Oh, right. Good point. I'll take it out of _LDBL_EQ_DOUBLE.


-- Jeff J.

Jon Roelofs
CodeSourcery / Mentor Embedded

Jon Roelofs
CodeSourcery / Mentor Embedded

Attachment: newlib_nexttoward5.diff
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]