From 3bf40917fcff912f97d389cf54180203fff13909 Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Thu, 8 Nov 2001 19:08:34 +0000 Subject: [PATCH] 2001-11-07 Michael Snyder * gdb.base/callfuncs.c (t_float_values): This function must _not_ be prototyped, and the following function (t_float_values2) must be prototyped (if the compiler supports it), so that GDB can be tested against both cases. Usually one case involves promotion of float to double, while the other does not. * gdb.base/callfwmall.c: Ditto. --- gdb/testsuite/ChangeLog | 6 ++++++ gdb/testsuite/gdb.base/callfuncs.c | 15 ++++++++------- gdb/testsuite/gdb.base/callfwmall.c | 15 ++++++++------- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 8e47b316b78..0716da15df6 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,11 @@ 2001-11-07 Michael Snyder + * gdb.base/callfuncs.c (t_float_values): This function must + _not_ be prototyped, and the following function (t_float_values2) + must be prototyped (if the compiler supports it), so that GDB + can be tested against both cases. Usually one case involves + promotion of float to double, while the other does not. + * gdb.base/callfwmall.c: Ditto. * gdb.asm/asm-source.exp (bt ALL in foo2): Accept a backtrace that includes a stack frame for "start". diff --git a/gdb/testsuite/gdb.base/callfuncs.c b/gdb/testsuite/gdb.base/callfuncs.c index f53bd3177cb..0fdc2fe0cc7 100644 --- a/gdb/testsuite/gdb.base/callfuncs.c +++ b/gdb/testsuite/gdb.base/callfuncs.c @@ -237,12 +237,13 @@ long long_arg1, long_arg2; return ((long_arg1 == long_val1) && (long_arg2 == long_val2)); } -#ifdef PROTOTYPES -int t_float_values (float float_arg1, float float_arg2) -#else +/* NOTE: THIS FUNCTION MUST NOT BE PROTOTYPED!!!!! + There must be one version of "t_float_values" (this one) + that is not prototyped, and one (if supported) that is (following). + That way GDB can be tested against both cases. */ + int t_float_values (float_arg1, float_arg2) float float_arg1, float_arg2; -#endif { return ((float_arg1 - float_val1) < DELTA && (float_arg1 - float_val1) > -DELTA @@ -251,13 +252,13 @@ float float_arg1, float_arg2; } int -#ifdef PROTOTYPES -t_float_values2 (float float_arg1, float float_arg2) -#else +#ifdef NO_PROTOTYPES /* In this case we are just duplicating t_float_values, but that is the easiest way to deal with either ANSI or non-ANSI. */ t_float_values2 (float_arg1, float_arg2) float float_arg1, float_arg2; +#else +t_float_values2 (float float_arg1, float float_arg2) #endif { return ((float_arg1 - float_val1) < DELTA diff --git a/gdb/testsuite/gdb.base/callfwmall.c b/gdb/testsuite/gdb.base/callfwmall.c index 550a970fba1..89e6a771116 100644 --- a/gdb/testsuite/gdb.base/callfwmall.c +++ b/gdb/testsuite/gdb.base/callfwmall.c @@ -244,12 +244,13 @@ long long_arg1, long_arg2; return ((long_arg1 == long_val1) && (long_arg2 == long_val2)); } -#ifdef PROTOTYPES -int t_float_values (float float_arg1, float float_arg2) -#else +/* NOTE: THIS FUNCTION MUST NOT BE PROTOTYPED!!!!! + There must be one version of "t_float_values" (this one) + that is not prototyped, and one (if supported) that is (following). + That way GDB can be tested against both cases. */ + int t_float_values (float_arg1, float_arg2) float float_arg1, float_arg2; -#endif { return ((float_arg1 - float_val1) < DELTA && (float_arg1 - float_val1) > -DELTA @@ -258,13 +259,13 @@ float float_arg1, float_arg2; } int -#ifdef PROTOTYPES -t_float_values2 (float float_arg1, float float_arg2) -#else +#ifdef NO_PROTOTYPES /* In this case we are just duplicating t_float_values, but that is the easiest way to deal with either ANSI or non-ANSI. */ t_float_values2 (float_arg1, float_arg2) float float_arg1, float_arg2; +#else +t_float_values2 (float float_arg1, float float_arg2) #endif { return ((float_arg1 - float_val1) < DELTA -- 2.30.2