Also add comments explaining how I generated these test cases.
(No autoconf back doors hidden in these magic numbers, I promise! No
pythagoreans were harmed in the production of these tests either.)
This test, to verify nexttoward(x, x*(1 - LDBL_EPSILON/2)) moves in
the direction of x*(1 - LDBL_EPSILON/2), only makes sense if long
double has more precision than double -- the point of the exercise is
to verify that nexttoward moves even if the direction parameter can't
be rounded to double. But if long double is just double, this test
makes no sense.
This may not be formally required by the standard, but the values
must be representable by int since that's the type that functions
like fetestexcept and feclearexcept traffic in. And this is less
work than changing all the printf %d users in tree.
When using the Clang preprocessor (with MKLLVM=yes), the preprocessor
output does not indicate which tokens come from a system header and
which tokens come from the user code. Lint's strict bool mode relies on
this information to treat the character classification functions from
<ctype.h> as if their return type were bool instead of int.
These wrapper functions are only used when their argument is indeed a
'char', but not when the argument might be 'EOF or representable as an
unsigned char', such as when reading a byte from the input.
These diagnostics are emitted by lint2, and like all diagnostics from
lint2, they don't affect the exit status.
In libc, lint cannot handle the renamings from namespace.h, generating
many false positive diagnostics since 'libc_function' is used but
'_libc_function' is defined. Until this situation is handled properly,
suppress this diagnostic.
Even though 0 is not a boolean constant, allow this common idiom, to
help in those cases where the C preprocessor used by lint does not mark
tokens as coming from system headers (Clang).
Lint doesn't need this comment anymore, as there is nothing surprising
or unusual about this idiom.
sed -Ei 's,} *while *\(/\* *CONSTCOND *\*/ *0\),} while (0),' *.h
To access yytext from lex.c, the lexer needs to be in %pointer mode,
which was specified in IEEE Std 1003.1, 2004 Edition and thus should be
old enough to be available on platforms other than NetBSD, for use in
tools/lint1 where lint1 is built before yacc and lex.
1. Need <math.h> for __HAVE_LONG_DOUBLE.
2. Need <machine/ieee.h> for struct ieee_ext_u &c.
3. EXT_FRACLBITS, not LDBL_MANL_SIZE.
PR lib/58245: hypotl is broken on ld128 ports