<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 11, 2023 at 8:46 AM <<a href="mailto:Jan.Sommer@dlr.de">Jan.Sommer@dlr.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg-8998744838238107073">





<div lang="EN-US">
<div class="m_-8998744838238107073WordSection1">
<p class="MsoNormal">Ah, thanks for the clarification.</p></div></div></div></blockquote><div><br></div><div>FWIW in case someone looks at this, I think this impacts aarch64, x86, powerpc, and maybe one other architecture. I just don't remember for sure.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg-8998744838238107073"><div lang="EN-US"><div class="m_-8998744838238107073WordSection1"><p class="MsoNormal"><u></u><u></u></p>
<p class="MsoNormal">If I can be of any help with the porting, let me know.</p></div></div></div></blockquote><div><br></div><div>Thanks. Maybe some testing.</div><div><br></div><div>--joel </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg-8998744838238107073"><div lang="EN-US"><div class="m_-8998744838238107073WordSection1"><p class="MsoNormal"><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div style="border-top:none;border-right:none;border-bottom:none;border-left:1.5pt solid blue;padding:0cm 0cm 0cm 4pt">
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b>From:</b> Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>> <br>
<b>Sent:</b> Mittwoch, 11. Januar 2023 14:08<br>
<b>To:</b> Sommer, Jan <<a href="mailto:Jan.Sommer@dlr.de" target="_blank">Jan.Sommer@dlr.de</a>><br>
<b>Cc:</b> <a href="mailto:rtems-users@rtems.org" target="_blank">rtems-users@rtems.org</a> <<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a>><br>
<b>Subject:</b> Re: C++ math functions not available in namespace std<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">This happens on the architectures where size of long double is not the same as double. The header file disables everything if any math method is missing.<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I have it on my list to address. I was porting the long double methods from FreeBSD before anyone ran into this but haven't finished <u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Wed, Jan 11, 2023, 3:43 AM <<a href="mailto:Jan.Sommer@dlr.de" target="_blank">Jan.Sommer@dlr.de</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">Hello and happy New Year,<br>
<br>
I stumbled upon a slightly weird problem with the current cross-compilers.<br>
According to <a href="https://en.cppreference.com/w/cpp/numeric/math/fmax" target="_blank">
https://en.cppreference.com/w/cpp/numeric/math/fmax</a> std::fmax should be part of <cmath> for >= C++11.<br>
However, if I try to use it, I sometimes get  "error: 'fmax' is not a member of 'std'; did you mean 'max'?"<br>
<br>
I do get the error when compiling the test file (see below) with  i386-rtems6-g++ and riscv-rtems6-g++, but for example not for arm-rtems6-g++.<br>
If I use "fmax" instead of "std::fmax" the file compiles for all 3 architectures.
<br>
However, I have a library which uses the math functions with the namespace qualifier, which I cannot change that easily.<br>
<br>
Does someone know, what is the reason for that behavior (I guess it's related to newlib?) and what a solution could look like?<br>
<br>
Best regards,<br>
<br>
    Jan<br>
<br>
<br>
PS: My test file looks like this:<br>
<br>
#include <cmath><br>
<br>
double test(double a, double b)<br>
{<br>
    return std::fmax(a, b);<br>
}<br>
<br>
<br>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/users" target="_blank">http://lists.rtems.org/mailman/listinfo/users</a><u></u><u></u></p>
</blockquote>
</div>
</div>
</div>
</div>

</div></blockquote></div></div>