|
From: | Steven G. Johnson |
Subject: | Re: gnulib warnings when compiling Faddeeva.cc |
Date: | Fri, 14 Dec 2012 14:13:06 -0500 |
User-agent: | Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20 |
On 12/14/12 1:25 PM, John W. Eaton wrote:
On 13-Dec-2012, Steven G. Johnson wrote: | John W. Eaton wrote: |> On 13-Dec-2012, Steven G. Johnson wrote: |> | Except that there is no gnulib "cmath" header file as far as I can tell. |> |> I think cmath includes math.h on most systems. That may not be |> required, but it's the way it works with GNU libstdc++ headers. | | Probably is more portable to include<math.h> directly, since it can't | be guaranteed that cmath will #include math.h or that it will be | compatible with the gnulib one. I'd prefer to include cmath in C++ code.
The options are: a) use ::floor, and accept the (innocuous) warningb) use <cmath> and GNULIB_NAMESPACE::floor; this may be nonportable since it assumes that the system <cmath> header includes math.h and is compatible with the gnulib math.h
c) use <math.h> and GNULIB_NAMESPACE::floor; this should be portable since math.h is still in the C++ standard (despite being deprecated).
d) change gnulib to provide a <cmath> header and use (b); this may take some time, so in the meantime one needs to pick (a)-(c).
--SGJ
[Prev in Thread] | Current Thread | [Next in Thread] |