Here's the full code of mathcalls-helper-functions.h:
/* Classify given number. */
__MATHDECL_ALIAS (int, __fpclassify,, (_Mdouble_ __value), fpclassify)
__attribute__ ((__const__));
/* Test for negative number. */
__MATHDECL_ALIAS (int, __signbit,, (_Mdouble_ __value), signbit)
__attribute__ ((__const__));
/* Return 0 if VALUE is finite or NaN, +1 if it
is +Infinity, -1 if it is -Infinity. */
__MATHDECL_ALIAS (int, __isinf,, (_Mdouble_ __value), isinf)
__attribute__ ((__const__));
/* Return nonzero if VALUE is finite and not NaN. Used by isfinite macro. */
__MATHDECL_ALIAS (int, __finite,, (_Mdouble_ __value), finite)
__attribute__ ((__const__));
/* Return nonzero if VALUE is not a number. */
__MATHDECL_ALIAS (int, __isnan,, (_Mdouble_ __value), isnan)
__attribute__ ((__const__));
/* Test equality. */
__MATHDECL_ALIAS (int, __iseqsig,, (_Mdouble_ __x, _Mdouble_ __y), iseqsig);
/* Test for signaling NaN. */
__MATHDECL_ALIAS (int, __issignaling,, (_Mdouble_ __value), issignaling)
__attribute__ ((__const__));
And here's the error message:
In file included from <command-line>:
/home/gunther/place/dlang/dmd/generated/linux/debug/64/../../../../druntime/import/importc.h:80:8: warning: undefining "__has_builtin"
80 | #undef __has_builtin
| ^~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h(21): Error: undefined identifier `_Float128`
/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h(25): Error: undefined identifier `_Float128`
/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h(30): Error: undefined identifier `_Float128`
/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h(34): Error: undefined identifier `_Float128`
/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h(38): Error: undefined identifier `_Float128`
/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h(41): Error: undefined identifier `_Float128`
/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h(41): Error: undefined identifier `_Float128`
/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h(45): Error: undefined identifier `_Float128`
The lines corresponding to the error message are all
__attribute__ ((__const__));
Comment #1 by bugzilla — 2023-06-01T07:25:50Z
I can't repro this. My Linux system does not have mathcalls-helper-functions.h, nor _Float128.
The current master also compiles __attribute__((__const__)).
I'm going to mark this as "worksforme". If this problem persists, feel free to reopen it, with some context.
Comment #2 by lance — 2023-06-01T11:16:33Z
(In reply to Walter Bright from comment #1)
> I can't repro this. My Linux system does not have
> mathcalls-helper-functions.h, nor _Float128.
>
> The current master also compiles __attribute__((__const__)).
>
> I'm going to mark this as "worksforme". If this problem persists, feel free
> to reopen it, with some context.
You must have a very old Linux system - mathcalls-helper-functions.h was added to glibc and _Float128 was added to gcc many years ago.
Anyway, as you note, __attribute__((__const__)) works and _Float128 has been fixed in importc.h: https://github.com/dlang/dmd/blob/master/druntime/src/importc.h#L144
It should be closed as "fixed".