mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-04 23:50:27 +00:00
Work around bogus old gcc "initializer element is not constant" error
After df3b437c1e
, older gcc's such as
4.2.1 (still used on earlier branches for e.g. mips and powerpc) and
6.3.0 (still used for some cross-builds) started throwing bogus errors
like:
In file included from /workspace/src/lib/msun/src/s_llround.c:11:0:
/workspace/src/lib/msun/src/s_lround.c:54:31: error: initializer element is not constant
static const type dtype_min = type_min - 0.5;
^~~~~~~~
/workspace/src/lib/msun/src/s_lround.c:55:31: error: initializer element is not constant
static const type dtype_max = type_max + 0.5;
^~~~~~~~
Since 'type_min' and 'type_max' are constants declared just above these
lines this error is nonsensical, but older gcc's are not smart enough.
Work around the error by reusing the (type)DTYPE_MIN and (type)DTYPE_MAX
macros, so I can MFC this right away, unbreaking a few stable builds.
MFC after: immediately
This commit is contained in:
parent
6df35af4d8
commit
0bcd49c13a
|
@ -51,8 +51,8 @@ __FBSDID("$FreeBSD$");
|
|||
*/
|
||||
static const type type_min = (type)DTYPE_MIN;
|
||||
static const type type_max = (type)DTYPE_MAX;
|
||||
static const type dtype_min = type_min - 0.5;
|
||||
static const type dtype_max = type_max + 0.5;
|
||||
static const type dtype_min = (type)DTYPE_MIN - 0.5;
|
||||
static const type dtype_max = (type)DTYPE_MAX + 0.5;
|
||||
#define INRANGE(x) (dtype_max - type_max != 0.5 || \
|
||||
((x) > dtype_min && (x) < dtype_max))
|
||||
|
||||
|
|
Loading…
Reference in a new issue