libc/include/math.h: Remove parameter name

Message ID 1600702161-13623-1-git-send-email-christophe.lyon@linaro.org
State New
Headers show
Series
  • libc/include/math.h: Remove parameter name
Related show

Commit Message

Torbjorn SVENSSON via Newlib Sept. 21, 2020, 3:29 p.m.
As discussed in GCC bug 97088
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97088), parameters in
prototypes of library functions should use reserved names, or no name
at all.

This patch removes the 'x' parameter name from
extern int __isinff (float);
extern int __isinfd (double);
extern int __isnanf (float);
extern int __isnand (double);
extern int __fpclassifyf (float);
extern int __fpclassifyd (double);
extern int __signbitf (float);
extern int __signbitd (double);

to avoid possible clashes with user code in case someone uses
before including Newlib's math.h (or uses some other conflicting
definition)
---
 newlib/libc/include/math.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

-- 
2.7.4

Comments

Torbjorn SVENSSON via Newlib Sept. 22, 2020, 10:07 p.m. | #1
Hi Christophe,

Can you please resend the patch as an attachment?

Thanks,

-- Jeff J.

On Mon, Sep 21, 2020 at 11:29 AM Christophe Lyon via Newlib <
newlib@sourceware.org> wrote:

> As discussed in GCC bug 97088

> (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97088), parameters in

> prototypes of library functions should use reserved names, or no name

> at all.

>

> This patch removes the 'x' parameter name from

> extern int __isinff (float);

> extern int __isinfd (double);

> extern int __isnanf (float);

> extern int __isnand (double);

> extern int __fpclassifyf (float);

> extern int __fpclassifyd (double);

> extern int __signbitf (float);

> extern int __signbitd (double);

>

> to avoid possible clashes with user code in case someone uses

> before including Newlib's math.h (or uses some other conflicting

> definition)

> ---

>  newlib/libc/include/math.h | 16 ++++++++--------

>  1 file changed, 8 insertions(+), 8 deletions(-)

>

> diff --git a/newlib/libc/include/math.h b/newlib/libc/include/math.h

> index 5e6155c..ba1a8a1 100644

> --- a/newlib/libc/include/math.h

> +++ b/newlib/libc/include/math.h

> @@ -201,14 +201,14 @@ extern int isnan (double);

>  # define math_errhandling (_MATH_ERRHANDLING_ERRNO |

> _MATH_ERRHANDLING_ERREXCEPT)

>  #endif

>

> -extern int __isinff (float x);

> -extern int __isinfd (double x);

> -extern int __isnanf (float x);

> -extern int __isnand (double x);

> -extern int __fpclassifyf (float x);

> -extern int __fpclassifyd (double x);

> -extern int __signbitf (float x);

> -extern int __signbitd (double x);

> +extern int __isinff (float);

> +extern int __isinfd (double);

> +extern int __isnanf (float);

> +extern int __isnand (double);

> +extern int __fpclassifyf (float);

> +extern int __fpclassifyd (double);

> +extern int __signbitf (float);

> +extern int __signbitd (double);

>

>  /* Note: isinf and isnan were once functions in newlib that took double

>   *       arguments.  C99 specifies that these names are reserved for

> macros

> --

> 2.7.4

>

>
Torbjorn SVENSSON via Newlib Sept. 23, 2020, 9:23 a.m. | #2
On Wed, 23 Sep 2020 at 00:07, Jeff Johnston <jjohnstn@redhat.com> wrote:
>

> Hi Christophe,

>

> Can you please resend the patch as an attachment?

>


Sure, here it is.

Christohe

> Thanks,

>

> -- Jeff J.

>

> On Mon, Sep 21, 2020 at 11:29 AM Christophe Lyon via Newlib <newlib@sourceware.org> wrote:

>>

>> As discussed in GCC bug 97088

>> (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97088), parameters in

>> prototypes of library functions should use reserved names, or no name

>> at all.

>>

>> This patch removes the 'x' parameter name from

>> extern int __isinff (float);

>> extern int __isinfd (double);

>> extern int __isnanf (float);

>> extern int __isnand (double);

>> extern int __fpclassifyf (float);

>> extern int __fpclassifyd (double);

>> extern int __signbitf (float);

>> extern int __signbitd (double);

>>

>> to avoid possible clashes with user code in case someone uses

>> before including Newlib's math.h (or uses some other conflicting

>> definition)

>> ---

>>  newlib/libc/include/math.h | 16 ++++++++--------

>>  1 file changed, 8 insertions(+), 8 deletions(-)

>>

>> diff --git a/newlib/libc/include/math.h b/newlib/libc/include/math.h

>> index 5e6155c..ba1a8a1 100644

>> --- a/newlib/libc/include/math.h

>> +++ b/newlib/libc/include/math.h

>> @@ -201,14 +201,14 @@ extern int isnan (double);

>>  # define math_errhandling (_MATH_ERRHANDLING_ERRNO | _MATH_ERRHANDLING_ERREXCEPT)

>>  #endif

>>

>> -extern int __isinff (float x);

>> -extern int __isinfd (double x);

>> -extern int __isnanf (float x);

>> -extern int __isnand (double x);

>> -extern int __fpclassifyf (float x);

>> -extern int __fpclassifyd (double x);

>> -extern int __signbitf (float x);

>> -extern int __signbitd (double x);

>> +extern int __isinff (float);

>> +extern int __isinfd (double);

>> +extern int __isnanf (float);

>> +extern int __isnand (double);

>> +extern int __fpclassifyf (float);

>> +extern int __fpclassifyd (double);

>> +extern int __signbitf (float);

>> +extern int __signbitd (double);

>>

>>  /* Note: isinf and isnan were once functions in newlib that took double

>>   *       arguments.  C99 specifies that these names are reserved for macros

>> --

>> 2.7.4

>>
From 4680acecaac6a1bd2f8da06ed3e3403e8a66ed44 Mon Sep 17 00:00:00 2001
From: Christophe Lyon <christophe.lyon@linaro.org>
Date: Mon, 21 Sep 2020 15:22:30 +0000
Subject: [PATCH] libc/include/math.h: Remove parameter name

As discussed in GCC bug 97088
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97088), parameters in
prototypes of library functions should use reserved names, or no name
at all.

This patch removes the 'x' parameter name from
extern int __isinff (float);
extern int __isinfd (double);
extern int __isnanf (float);
extern int __isnand (double);
extern int __fpclassifyf (float);
extern int __fpclassifyd (double);
extern int __signbitf (float);
extern int __signbitd (double);

to avoid possible clashes with user code in case someone uses
before including Newlib's math.h (or uses some other conflicting
definition)
---
 newlib/libc/include/math.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/newlib/libc/include/math.h b/newlib/libc/include/math.h
index 5e6155c..ba1a8a1 100644
--- a/newlib/libc/include/math.h
+++ b/newlib/libc/include/math.h
@@ -201,14 +201,14 @@ extern int isnan (double);
 # define math_errhandling (_MATH_ERRHANDLING_ERRNO | _MATH_ERRHANDLING_ERREXCEPT)
 #endif
 
-extern int __isinff (float x);
-extern int __isinfd (double x);
-extern int __isnanf (float x);
-extern int __isnand (double x);
-extern int __fpclassifyf (float x);
-extern int __fpclassifyd (double x);
-extern int __signbitf (float x);
-extern int __signbitd (double x);
+extern int __isinff (float);
+extern int __isinfd (double);
+extern int __isnanf (float);
+extern int __isnand (double);
+extern int __fpclassifyf (float);
+extern int __fpclassifyd (double);
+extern int __signbitf (float);
+extern int __signbitd (double);
 
 /* Note: isinf and isnan were once functions in newlib that took double
  *       arguments.  C99 specifies that these names are reserved for macros
Torbjorn SVENSSON via Newlib Sept. 26, 2020, 2:54 a.m. | #3
Patch pushed to master.  Thanks.

-- Jeff J

On Wed, Sep 23, 2020 at 5:23 AM Christophe Lyon <christophe.lyon@linaro.org>
wrote:

> On Wed, 23 Sep 2020 at 00:07, Jeff Johnston <jjohnstn@redhat.com> wrote:

> >

> > Hi Christophe,

> >

> > Can you please resend the patch as an attachment?

> >

>

> Sure, here it is.

>

> Christohe

>

> > Thanks,

> >

> > -- Jeff J.

> >

> > On Mon, Sep 21, 2020 at 11:29 AM Christophe Lyon via Newlib <

> newlib@sourceware.org> wrote:

> >>

> >> As discussed in GCC bug 97088

> >> (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97088), parameters in

> >> prototypes of library functions should use reserved names, or no name

> >> at all.

> >>

> >> This patch removes the 'x' parameter name from

> >> extern int __isinff (float);

> >> extern int __isinfd (double);

> >> extern int __isnanf (float);

> >> extern int __isnand (double);

> >> extern int __fpclassifyf (float);

> >> extern int __fpclassifyd (double);

> >> extern int __signbitf (float);

> >> extern int __signbitd (double);

> >>

> >> to avoid possible clashes with user code in case someone uses

> >> before including Newlib's math.h (or uses some other conflicting

> >> definition)

> >> ---

> >>  newlib/libc/include/math.h | 16 ++++++++--------

> >>  1 file changed, 8 insertions(+), 8 deletions(-)

> >>

> >> diff --git a/newlib/libc/include/math.h b/newlib/libc/include/math.h

> >> index 5e6155c..ba1a8a1 100644

> >> --- a/newlib/libc/include/math.h

> >> +++ b/newlib/libc/include/math.h

> >> @@ -201,14 +201,14 @@ extern int isnan (double);

> >>  # define math_errhandling (_MATH_ERRHANDLING_ERRNO |

> _MATH_ERRHANDLING_ERREXCEPT)

> >>  #endif

> >>

> >> -extern int __isinff (float x);

> >> -extern int __isinfd (double x);

> >> -extern int __isnanf (float x);

> >> -extern int __isnand (double x);

> >> -extern int __fpclassifyf (float x);

> >> -extern int __fpclassifyd (double x);

> >> -extern int __signbitf (float x);

> >> -extern int __signbitd (double x);

> >> +extern int __isinff (float);

> >> +extern int __isinfd (double);

> >> +extern int __isnanf (float);

> >> +extern int __isnand (double);

> >> +extern int __fpclassifyf (float);

> >> +extern int __fpclassifyd (double);

> >> +extern int __signbitf (float);

> >> +extern int __signbitd (double);

> >>

> >>  /* Note: isinf and isnan were once functions in newlib that took double

> >>   *       arguments.  C99 specifies that these names are reserved for

> macros

> >> --

> >> 2.7.4

> >>

>

Patch

diff --git a/newlib/libc/include/math.h b/newlib/libc/include/math.h
index 5e6155c..ba1a8a1 100644
--- a/newlib/libc/include/math.h
+++ b/newlib/libc/include/math.h
@@ -201,14 +201,14 @@  extern int isnan (double);
 # define math_errhandling (_MATH_ERRHANDLING_ERRNO | _MATH_ERRHANDLING_ERREXCEPT)
 #endif
 
-extern int __isinff (float x);
-extern int __isinfd (double x);
-extern int __isnanf (float x);
-extern int __isnand (double x);
-extern int __fpclassifyf (float x);
-extern int __fpclassifyd (double x);
-extern int __signbitf (float x);
-extern int __signbitd (double x);
+extern int __isinff (float);
+extern int __isinfd (double);
+extern int __isnanf (float);
+extern int __isnand (double);
+extern int __fpclassifyf (float);
+extern int __fpclassifyd (double);
+extern int __signbitf (float);
+extern int __signbitd (double);
 
 /* Note: isinf and isnan were once functions in newlib that took double
  *       arguments.  C99 specifies that these names are reserved for macros