aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog24
-rw-r--r--FAQ.in10
-rw-r--r--math/libm-test.c1810
-rw-r--r--nis/rpcsvc/nis.h20
-rw-r--r--nis/rpcsvc/nis.x91
-rw-r--r--nis/rpcsvc/nis_object.x68
-rw-r--r--string/envz.h6
-rw-r--r--sunrpc/auth_des.c81
-rw-r--r--sunrpc/rpc/xdr.h37
-rw-r--r--sunrpc/rpc_hout.c15
-rw-r--r--sunrpc/rpc_main.c13
-rw-r--r--sunrpc/rpc_svcout.c14
-rw-r--r--sysdeps/unix/sysv/linux/alpha/setfpucw.c4
13 files changed, 1073 insertions, 1120 deletions
diff --git a/ChangeLog b/ChangeLog
index 2149287e4b..de646fff72 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+1998-12-01 Thorsten Kukuk <kukuk@vt.uni-paderborn.de>
+
+ * sunrpc/auth_des.c: Use new XDR int32 functions for integers.
+ * sunrpc/rpc/xdr.h: Add IXDR INT32 functions.
+ * sunrpc/rpc_hout.c: Remove (u_long) casts in defines to avoid
+ conflicts with new solaris version.
+ * sunrpc/rpc_main.c: Fix bug in generating Makefile name (malloc
+ doesn't zero allocated memory).
+ * sunrpc/rpc_svcout.c: Local variables now starts with a _ to avoid
+ conflicts with xdr functions. Solves PR libc/877.
+ * nis/rpcsvc/nis.x: Use always uint32_t.
+ * nis/rpcsvc/nis.h: Likewise.
+ * nis/rpcsvc/nis_object.x: Likewise.
+
+1998-12-01 Ulrich Drepper <drepper@cygnus.com>
+
+ * math/libm-test.c: Various cleanups. Patch by Zack Weinberg.
+
+ * sysdeps/unix/sysv/linux/alpha/setfpucw.c: Use correct type for
+ parameter. Patch by Christian Gafton.
+
+ * string/envz.h: Add prototype for envz_remove.
+ Reported by Andreas Jaeger.
+
1998-11-30 Mark Kettenis <kettenis@phys.uva.nl>
* mach/Versions [libc, GLIBC_2.0]: Add __spin_lock,
diff --git a/FAQ.in b/FAQ.in
index 452d76ab09..b1bd299e3f 100644
--- a/FAQ.in
+++ b/FAQ.in
@@ -1140,6 +1140,16 @@ taken care in user programs using the firewall structures and therefore
those programs (ipfw is AFAIK the only one) should deal with this problem
themselves.
+?? I get floods of warnings when I use -Wconversion and include
+ <string.h> or <math.h>.
+
+{ZW} <string.h> and <math.h> intentionally use prototypes to override
+argument promotion. -Wconversion warns about all these. You can safely
+ignore the warnings.
+
+-Wconversion isn't really intended for production use, only for shakedown
+compiles after converting an old program to standard C.
+
? Miscellaneous
diff --git a/math/libm-test.c b/math/libm-test.c
index 86616a4404..2f57ef21bd 100644
--- a/math/libm-test.c
+++ b/math/libm-test.c
@@ -17,9 +17,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-
-/*
- Part of testsuite for libm.
+/* Part of testsuite for libm.
This file has to be included by a master file that defines:
@@ -27,16 +25,16 @@
FUNC(function): converts general function name (like cos) to
name with correct suffix (e.g. cosl or cosf)
MATHCONST(x): like FUNC but for constants (e.g convert 0.0 to 0.0L)
- MATHTYPE: floating point type to test
- TEST_MSG: informal message to be displayed
+ MATHTYPE: floating point type to test
+ TEST_MSG: informal message to be displayed
CHOOSE(Clongdouble,Cdouble,Cfloat):
chooses one of the parameters as epsilon for testing
equality
- PRINTF_EXPR Floating point conversion specification to print a variable
- of type MATHTYPE with printf. PRINTF_EXPR just contains
+ PRINTF_EXPR Floating point conversion specification to print a variable
+ of type MATHTYPE with printf. PRINTF_EXPR just contains
the specifier, not the percent and width arguments,
e.g. "f".
- PRINTF_XEXPR Like PRINTF_EXPR, but print in hexadecimal format.
+ PRINTF_XEXPR Like PRINTF_EXPR, but print in hexadecimal format.
*/
/* This program isn't finished yet.
@@ -58,12 +56,12 @@
ccos, ccosh, cexp, clog, cpow, csin, csinh, csqrt, ctan, ctanh.
At the moment the following functions aren't tested:
-OB conj, cproj, cimag, creal, drem,
+ conj, cproj, cimag, creal, drem,
j0, j1, jn, y0, y1, yn,
significand,
nan
- The routines using random variables are still under construction. I don't
+ The routines using random variables are still under construction. I don't
like it the way it's working now and will change it.
Parameter handling is primitive in the moment:
@@ -82,25 +80,25 @@ OB conj, cproj, cimag, creal, drem,
This suite tests some aspects of the correct implementation of
mathematical functions in libm. Some simple, specific parameters
are tested for correctness but there's no exhaustive
- testing. Handling of specific inputs (e.g. infinity, not-a-number)
- is also tested. Correct handling of exceptions is checked
- against. These implemented tests should check all cases that are
+ testing. Handling of specific inputs (e.g. infinity, not-a-number)
+ is also tested. Correct handling of exceptions is checked
+ against. These implemented tests should check all cases that are
specified in ISO C 9X.
Exception testing: At the moment only divide-by-zero and invalid
- exceptions are tested. Overflow/underflow and inexact exceptions
+ exceptions are tested. Overflow/underflow and inexact exceptions
aren't checked at the moment.
- NaN values: There exist signalling and quiet NaNs. This implementation
+ NaN values: There exist signalling and quiet NaNs. This implementation
only uses signalling NaN as parameter but does not differenciate
between the two kinds of NaNs as result.
Inline functions: Inlining functions should give an improvement in
- speed - but not in precission. The inlined functions return
- reasonable values for a reasonable range of input values. The
+ speed - but not in precission. The inlined functions return
+ reasonable values for a reasonable range of input values. The
result is not necessarily correct for all values and exceptions are
- not correctly raised in all cases. Problematic input and return
- values are infinity, not-a-number and minus zero. This suite
+ not correctly raised in all cases. Problematic input and return
+ values are infinity, not-a-number and minus zero. This suite
therefore does not check these specific inputs and the exception
handling for inlined mathematical functions - just the "reasonable"
values are checked.
@@ -112,8 +110,7 @@ OB conj, cproj, cimag, creal, drem,
- Compiler has errors
With e.g. gcc 2.7.2.2 the test for cexp fails because of a compiler error.
-
-*/
+ */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
@@ -130,21 +127,21 @@ OB conj, cproj, cimag, creal, drem,
#include <getopt.h>
/* Possible exceptions */
-#define NO_EXCEPTION 0x0
-#define INVALID_EXCEPTION 0x1
+#define NO_EXCEPTION 0x0
+#define INVALID_EXCEPTION 0x1
#define DIVIDE_BY_ZERO_EXCEPTION 0x2
#define PRINT 1
#define NO_PRINT 0
/* Various constants (we must supply them precalculated for accuracy). */
-#define M_PI_6l .52359877559829887308L
+#define M_PI_6l .52359877559829887308L
#define M_E2l 7.389056098930650227230L
#define M_E3l 20.08553692318766774093L
-static int noErrors; /* number of errors */
-static int noTests; /* number of tests (without testing exceptions) */
-static int noExcTests; /* number of tests for exception flags */
+static int noErrors; /* number of errors */
+static int noTests; /* number of tests (without testing exceptions) */
+static int noExcTests; /* number of tests for exception flags */
static int verbose = 3;
static MATHTYPE minus_zero, plus_zero;
@@ -166,23 +163,22 @@ typedef MATHTYPE (*mathfunc) (MATHTYPE);
isinf (x) : isinfl (x))
- /*
- Test if Floating-Point stack hasn't changed
- */
+/* Test if Floating-Point stack hasn't changed */
static void
fpstack_test (const char *test_name)
{
#ifdef i386
static int old_stack;
int sw;
-asm ("fnstsw":"=a" (sw));
+
+ asm ("fnstsw":"=a" (sw));
sw >>= 11;
sw &= 7;
+
if (sw != old_stack)
{
- printf ("FP-Stack wrong after test %s\n", test_name);
- if (verbose > 2)
- printf ("=======> stack = %d\n", sw);
+ printf ("FP-Stack wrong after test %s (%d, should be %d)\n",
+ test_name, sw, old_stack);
++noErrors;
old_stack = sw;
}
@@ -190,11 +186,9 @@ asm ("fnstsw":"=a" (sw));
}
-/*
- Get a random value x with min_value < x < max_value
+/* Get a random value x with min_value < x < max_value
and min_value, max_value finite,
- max_value and min_value shouldn't be too close together
- */
+ max_value and min_value shouldn't be too close together */
static MATHTYPE
random_value (MATHTYPE min_value, MATHTYPE max_value)
{
@@ -214,13 +208,15 @@ random_value (MATHTYPE min_value, MATHTYPE max_value)
return x;
}
+
/* Get a random value x with x > min_value. */
static MATHTYPE
random_greater (MATHTYPE min_value)
{
- return random_value (min_value, 1e6); /* CHOOSE (LDBL_MAX, DBL_MAX, FLT_MAX) */
+ return random_value (min_value, 1e6); /* CHOOSE(LDBL_MAX, DBL_MAX, FLT_MAX) */
}
+
/* Get a random value x with x < max_value. */
static MATHTYPE
random_less (MATHTYPE max_value)
@@ -246,7 +242,7 @@ output_pass_value (void)
static void
-output_fail_value (const char * test_name)
+output_fail_value (const char *test_name)
{
if (verbose > 0 && verbose < 3)
printf ("Fail: %s\n", test_name);
@@ -258,48 +254,48 @@ output_fail_value (const char * test_name)
/* Test whether a given exception was raised. */
static void
test_single_exception (const char *test_name,
- short int exception,
- short int exc_flag,
- int fe_flag,
- const char *flag_name)
+ short int exception,
+ short int exc_flag,
+ int fe_flag,
+ const char *flag_name)
{
#ifndef TEST_INLINE
if (exception & exc_flag)
{
if (fetestexcept (fe_flag))
- {
- if (verbose > 3)
- printf ("Pass: Exception \"%s\" set\n", flag_name);
- }
+ {
+ if (verbose > 3)
+ printf ("Pass: Exception \"%s\" set\n", flag_name);
+ }
else
- {
- if (verbose && verbose < 3)
- printf ("Fail: %s: Exception \"%s\" not set\n",
+ {
+ if (verbose && verbose < 3)
+ printf ("Fail: %s: Exception \"%s\" not set\n",
test_name, flag_name);
- if (verbose >= 3)
- printf ("Fail: Exception \"%s\" not set\n",
- flag_name);
- ++noErrors;
- }
+ if (verbose >= 3)
+ printf ("Fail: Exception \"%s\" not set\n",
+ flag_name);
+ ++noErrors;
+ }
}
else
{
if (fetestexcept (fe_flag))
- {
- if (verbose && verbose < 3)
- printf ("Fail: %s: Exception \"%s\" set\n",
+ {
+ if (verbose && verbose < 3)
+ printf ("Fail: %s: Exception \"%s\" set\n",
test_name, flag_name);
- if (verbose >= 3)
- printf ("Fail: Exception \"%s\" set\n",
- flag_name);
- ++noErrors;
- }
+ if (verbose >= 3)
+ printf ("Fail: Exception \"%s\" set\n",
+ flag_name);
+ ++noErrors;
+ }
else
- {
- if (verbose > 3)
- printf ("Pass: Exception \"%s\" not set\n",
+ {
+ if (verbose > 3)
+ printf ("Pass: Exception \"%s\" not set\n",
flag_name);
- }
+ }
}
#endif
}
@@ -332,12 +328,12 @@ test_exceptions (const char *test_name, short int exception)
++noExcTests;
#ifdef FE_DIVBYZERO
test_single_exception (test_name, exception,
- DIVIDE_BY_ZERO_EXCEPTION, FE_DIVBYZERO,
- "Divide by zero");
+ DIVIDE_BY_ZERO_EXCEPTION, FE_DIVBYZERO,
+ "Divide by zero");
#endif
#ifdef FE_INVALID
test_single_exception (test_name, exception, INVALID_EXCEPTION, FE_INVALID,
- "Invalid operation");
+ "Invalid operation");
#endif
feclearexcept (FE_ALL_EXCEPT);
}
@@ -360,16 +356,16 @@ check_equal (MATHTYPE computed, MATHTYPE supplied, MATHTYPE eps, MATHTYPE * diff
ret_value = (*diff <= eps &&
- (signbit (computed) == signbit (supplied) || eps != 0.0));
+ (signbit (computed) == signbit (supplied) || eps != 0.0));
- /* Make sure the subtraction/comparison have no influence on the exceptions. */
+ /* Make sure the subtraction/comparison
+ have no influence on the exceptions. */
feclearexcept (FE_ALL_EXCEPT);
return ret_value;
}
-
static void
output_result_bool (const char *test_name, int result)
{
@@ -382,7 +378,7 @@ output_result_bool (const char *test_name, int result)
{
output_fail_value (test_name);
if (verbose > 1)
- printf (" Value: %d\n", result);
+ printf (" Value: %d\n", result);
++noErrors;
}
@@ -455,12 +451,12 @@ output_result (const char *test_name, int result,
if (verbose > 1 && print_values)
{
printf ("Result:\n");
- printf (" is: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
+ printf (" is: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
computed, computed);
- printf (" should be: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
+ printf (" should be: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
expected, expected);
if (print_diff)
- printf (" difference: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR
+ printf (" difference: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR
"\n", difference, difference);
}
++noErrors;
@@ -488,14 +484,14 @@ output_result_ext (const char *test_name, int result,
if (verbose > 1 && print_values)
{
printf ("Result:\n");
- printf (" is: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
+ printf (" is: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
computed, computed);
- printf (" should be: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
+ printf (" should be: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
expected, expected);
if (print_diff)
- printf (" difference: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR
+ printf (" difference: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR
"\n", difference, difference);
- printf ("Parameter: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
+ printf ("Parameter: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
parameter, parameter);
}
++noErrors;
@@ -504,9 +500,8 @@ output_result_ext (const char *test_name, int result,
fpstack_test (test_name);
}
-/*
- check that computed and expected values are the same
- */
+
+/* check that computed and expected values are the same */
static void
check (const char *test_name, MATHTYPE computed, MATHTYPE expected)
{
@@ -521,10 +516,8 @@ check (const char *test_name, MATHTYPE computed, MATHTYPE expected)
}
-/*
- check that computed and expected values are the same,
- outputs the parameter to the function
- */
+/* check that computed and expected values are the same,
+ outputs the parameter to the function */
static void
check_ext (const char *test_name, MATHTYPE computed, MATHTYPE expected,
MATHTYPE parameter)
@@ -540,10 +533,8 @@ check_ext (const char *test_name, MATHTYPE computed, MATHTYPE expected,
}
-/*
- check that computed and expected values are the same and
- checks also for exception flags
- */
+/* check that computed and expected values are the same and
+ checks also for exception flags */
static void
check_exc (const char *test_name, MATHTYPE computed, MATHTYPE expected,
short exception)
@@ -558,9 +549,8 @@ check_exc (const char *test_name, MATHTYPE computed, MATHTYPE expected,
computed, expected, diff, PRINT, PRINT);
}
-/*
- check that computed and expected values are close enough
- */
+
+/* check that computed and expected values are close enough */
static void
check_eps (const char *test_name, MATHTYPE computed, MATHTYPE expected,
MATHTYPE epsilon)
@@ -575,9 +565,8 @@ check_eps (const char *test_name, MATHTYPE computed, MATHTYPE expected,
computed, expected, diff, PRINT, PRINT);
}
-/*
- check a boolean condition
- */
+
+/* check a boolean condition */
static void
check_bool (const char *test_name, int computed)
{
@@ -587,10 +576,7 @@ check_bool (const char *test_name, int computed)
}
-
-/*
- check that computed and expected values are equal (int values)
- */
+/* check that computed and expected values are equal (int values) */
static void
check_int (const char *test_name, int computed, int expected)
{
@@ -610,8 +596,8 @@ check_int (const char *test_name, int computed, int expected)
if (verbose > 1)
{
printf ("Result:\n");
- printf (" is: %d\n", computed);
- printf (" should be: %d\n", expected);
+ printf (" is: %d\n", computed);
+ printf (" should be: %d\n", expected);
}
noErrors++;
}
@@ -620,9 +606,7 @@ check_int (const char *test_name, int computed, int expected)
}
-/*
- check that computed and expected values are equal (long int values)
- */
+/* check that computed and expected values are equal (long int values) */
static void
check_long (const char *test_name, long int computed, long int expected)
{
@@ -643,8 +627,8 @@ check_long (const char *test_name, long int computed, long int expected)
if (verbose > 1)
{
printf ("Result:\n");
- printf (" is: %ld\n", computed);
- printf (" should be: %ld\n", expected);
+ printf (" is: %ld\n", computed);
+ printf (" should be: %ld\n", expected);
}
noErrors++;
}
@@ -652,9 +636,8 @@ check_long (const char *test_name, long int computed, long int expected)
fpstack_test (test_name);
}
-/*
- check that computed and expected values are equal (long long int values)
- */
+
+/* check that computed and expected values are equal (long long int values) */
static void
check_longlong (const char *test_name, long long int computed,
long long int expected)
@@ -676,8 +659,8 @@ check_longlong (const char *test_name, long long int computed,
if (verbose > 1)
{
printf ("Result:\n");
- printf (" is: %lld\n", computed);
- printf (" should be: %lld\n", expected);
+ printf (" is: %lld\n", computed);
+ printf (" should be: %lld\n", expected);
}
noErrors++;
}
@@ -685,9 +668,8 @@ check_longlong (const char *test_name, long long int computed,
fpstack_test (test_name);
}
-/*
- check that computed value is not-a-number
- */
+
+/* check that computed value is not-a-number */
static void
check_isnan (const char *test_name, MATHTYPE computed)
{
@@ -697,9 +679,7 @@ check_isnan (const char *test_name, MATHTYPE computed)
}
-/*
- check that computed value is not-a-number and test for exceptions
- */
+/* check that computed value is not-a-number and test for exceptions */
static void
check_isnan_exc (const char *test_name, MATHTYPE computed,
short exception)
@@ -710,9 +690,7 @@ check_isnan_exc (const char *test_name, MATHTYPE computed,
}
-/*
- check that computed value is not-a-number and test for exceptions
- */
+/* check that computed value is not-a-number and test for exceptions */
static void
check_isnan_maybe_exc (const char *test_name, MATHTYPE computed,
short exception)
@@ -722,9 +700,8 @@ check_isnan_maybe_exc (const char *test_name, MATHTYPE computed,
output_isvalue (test_name, isnan (computed), computed);
}
-/*
- check that computed value is not-a-number and supply parameter
- */
+
+/* check that computed value is not-a-number and supply parameter */
#ifndef TEST_INLINE
static void
check_isnan_ext (const char *test_name, MATHTYPE computed,
@@ -736,16 +713,14 @@ check_isnan_ext (const char *test_name, MATHTYPE computed,
}
#endif
-/*
- check that computed value is not-a-number, test for exceptions
- and supply parameter
- */
+/* check that computed value is not-a-number, test for exceptions
+ and supply parameter */
static void
check_isnan_exc_ext (const char *test_name, MATHTYPE computed,
- short exception, MATHTYPE parameter)
+ short exception, MATHTYPE parameter)
{
output_new_test (test_name);
- test_exceptions (test_name,exception);
+ test_exceptions (test_name, exception);
output_isvalue_ext (test_name, isnan (computed), computed, parameter);
}
@@ -760,6 +735,7 @@ check_isinfp (const char *test_name, MATHTYPE computed)
}
+/* Tests if computed is +Inf and supply parameter */
static void
check_isinfp_ext (const char *test_name, MATHTYPE computed,
MATHTYPE parameter)
@@ -770,7 +746,7 @@ check_isinfp_ext (const char *test_name, MATHTYPE computed,
}
-/* Tests if computed is +Inf */
+/* Tests if computed is +Inf and check exceptions */
static void
check_isinfp_exc (const char *test_name, MATHTYPE computed,
int exception)
@@ -780,6 +756,7 @@ check_isinfp_exc (const char *test_name, MATHTYPE computed,
output_isvalue (test_name, (ISINF (computed) == +1), computed);
}
+
/* Tests if computed is -Inf */
static void
check_isinfn (const char *test_name, MATHTYPE computed)
@@ -790,6 +767,7 @@ check_isinfn (const char *test_name, MATHTYPE computed)
}
+/* Tests if computed is -Inf and supply parameter */
#ifndef TEST_INLINE
static void
check_isinfn_ext (const char *test_name, MATHTYPE computed,
@@ -801,8 +779,7 @@ check_isinfn_ext (const char *test_name, MATHTYPE computed,
}
#endif
-
-/* Tests if computed is -Inf */
+/* Tests if computed is -Inf and check exceptions */
static void
check_isinfn_exc (const char *test_name, MATHTYPE computed,
int exception)
@@ -848,13 +825,12 @@ acos_test (void)
check ("acos (-1) == pi", FUNC(acos) (-1), M_PIl);
check_eps ("acos (0.5) == pi/3", FUNC(acos) (0.5), M_PI_6l * 2.0,
- CHOOSE (1e-18, 0, 0));
+ CHOOSE(1e-18, 0, 0));
check_eps ("ac