prevent warnings while vompiling clib/syscalls

Message ID 002601d3a0ca$64fb38e0$2ef1aaa0$@jasoon.nl
State New
Headers show
Series
  • prevent warnings while vompiling clib/syscalls
Related show

Commit Message

Jaap de Wolff Feb. 8, 2018, 10:48 a.m.
At this moment we get warnings while we compile the libc/syscalls folder.
This patch will prevent this

Jaap de Wolff

Comments

Sebastian Huber Feb. 8, 2018, 11 a.m. | #1
On 08/02/18 11:48, Jaap de Wolff wrote:
> At this moment we get warnings while we compile the libc/syscalls folder.

> This patch will prevent this

>

> Jaap de Wolff

> =======================PATCH===============================

> diff --git a/newlib/libc/syscalls/sysisatty.c

> b/newlib/libc/syscalls/sysisatty.c

> index 697c54bc4..f4e8789ce 100644

> --- a/newlib/libc/syscalls/sysisatty.c

> +++ b/newlib/libc/syscalls/sysisatty.c

> @@ -3,6 +3,11 @@

>   #include <reent.h>

>   #include <unistd.h>

>   

> +

> +/* forward declaration */

> +extern int _isatty_r(struct _reent *, int);

> +extern int _isatty(int);

> +

>   int

>   isatty (int fd)

>   {


These functions are already conditionally defined in <reent.h>. Why do 
we need additional function declarations in source files?

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Jaap de Wolff Feb. 8, 2018, 11:37 a.m. | #2
> -----Oorspronkelijk bericht-----

> Van: Sebastian Huber [mailto:sebastian.huber@embedded-brains.de]

> Verzonden: Thursday, February 8, 2018 12:01 PM

> Aan: Jaap de Wolff <info@jasoon.nl>; newlib@sourceware.org

> Onderwerp: Re: [PATCH] prevent warnings while vompiling clib/syscalls

> 

> On 08/02/18 11:48, Jaap de Wolff wrote:

> > At this moment we get warnings while we compile the libc/syscalls folder.

> > This patch will prevent this

> >

> > Jaap de Wolff

> > =======================PATCH===============================

> > diff --git a/newlib/libc/syscalls/sysisatty.c

> > b/newlib/libc/syscalls/sysisatty.c

> > index 697c54bc4..f4e8789ce 100644

> > --- a/newlib/libc/syscalls/sysisatty.c

> > +++ b/newlib/libc/syscalls/sysisatty.c

> > @@ -3,6 +3,11 @@

> >   #include <reent.h>

> >   #include <unistd.h>

> >

> > +

> > +/* forward declaration */

> > +extern int _isatty_r(struct _reent *, int); extern int _isatty(int);

> > +

> >   int

> >   isatty (int fd)

> >   {

> 

> These functions are already conditionally defined in <reent.h>. Why do we

> need additional function declarations in source files?

> 

> --

> Sebastian Huber, embedded brains GmbH

> 

> Address : Dornierstr. 4, D-82178 Puchheim, Germany

> Phone   : +49 89 189 47 41-16

> Fax     : +49 89 189 47 41-09

> E-Mail  : sebastian.huber@embedded-brains.de

> PGP     : Public key available on request.

> 

> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

With old code we get a warning about undefined functions, when compiling this "C" file.
This patch does solve that problem.
If you are right, and this is conditionally defined in <reent.h>,  we have to take a look at the conditions in <reent.h>.

Jaap de Wolff

Patch

=======================PATCH===============================
diff --git a/newlib/libc/syscalls/sysisatty.c
b/newlib/libc/syscalls/sysisatty.c
index 697c54bc4..f4e8789ce 100644
--- a/newlib/libc/syscalls/sysisatty.c
+++ b/newlib/libc/syscalls/sysisatty.c
@@ -3,6 +3,11 @@ 
 #include <reent.h>
 #include <unistd.h>
 
+
+/* forward declaration */
+extern int _isatty_r(struct _reent *, int);
+extern int _isatty(int);
+
 int
 isatty (int fd)
 {