]> git.ipfire.org Git - thirdparty/glibc.git/commit - math/tgmath.h
Do not declare fmax, fmin _FloatN, _FloatNx versions for C2X
authorJoseph Myers <joseph@codesourcery.com>
Wed, 29 Sep 2021 18:20:32 +0000 (18:20 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Wed, 29 Sep 2021 18:20:32 +0000 (18:20 +0000)
commit9bd9978639c2f75dbea5c25226264b1ac11fdf05
tree9caaa3482305a7b25f2b0798ac898e111f4d1eb0
parent79850e1025aabeccd3586c32ca259aa854607582
Do not declare fmax, fmin _FloatN, _FloatNx versions for C2X

At the last WG14 meeting,
<http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2711.htm> was
accepted, which places more emphasis on the new fmaximum / fminimum
functions and less on the old fmax / fmin functions.  Some of the
changes are to examples, notes or otherwise don't require
implementation changes.  However, the changes include removing the
_FloatN / _FloatNx versions of the fmax and fmin functions that came
from TS 18661-3.

Thus, those function versions should only be declared under similar
conditions to the _FloatN / _FloatNx versions of fmaxmag and fminmag:
for _GNU_SOURCE and pre-C2X use of __STDC_WANT_IEC_60559_TYPES_EXT__,
but not for C2X without _GNU_SOURCE.

In turn this requires a tgmath.h change so that the corresponding
tgmath.h macros, for C2X with __STDC_WANT_IEC_60559_TYPES_EXT__ but
without _GNU_SOURCE, don't try to use function variants that aren't
declared.  (That issue doesn't arise for the tgmath.h macros for
fmaxmag and fminmag, because those aren't defined at all in those
circumstances unless __STDC_WANT_IEC_60559_BFP_EXT__ (from TS 18661-1
and not specified at all by C2X) is also defined, and in that case the
_FloatN / _FloatNx versions of fmaxmag and fminmag get declared - this
is only ever an issue when it's possible for some functions
corresponding to a type-generic-macro to be declared, and for _FloatN
/ _FloatNx functions in general to be declared, but without the
_FloatN / _FloatNx functions corresponding to that particular macro
being declared.)

Tested for x86_64.
math/bits/mathcalls.h
math/tgmath.h