[v2] Unconditionally declare strsignal

Message ID 20211027164122.2268783-1-cbiesinger@google.com
State New
Headers show
Series
  • [v2] Unconditionally declare strsignal
Related show

Commit Message

Christian Biesinger via Newlib Oct. 27, 2021, 4:41 p.m.
Currently, newlib does not declare strsignal if DEFS_H is defined,
ostensibly to work around a gdb bug. However, gdb itself compiles
even with this ifndef removed, and this makes sim (another part of
gdb) fail to compile.

Since it is not clear exactly what issue this was working around,
this patch just replaces that ifdef with the correct check,
i.e. __POSIX_VISIBLE >= 200809.
---
 newlib/libc/include/string.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.33.0.1079.g6e70778dc9-goog

Comments

Corinna Vinschen Oct. 27, 2021, 6:07 p.m. | #1
On Oct 27 12:41, Christian Biesinger via Newlib wrote:
> Currently, newlib does not declare strsignal if DEFS_H is defined,

> ostensibly to work around a gdb bug. However, gdb itself compiles

> even with this ifndef removed, and this makes sim (another part of

> gdb) fail to compile.

> 

> Since it is not clear exactly what issue this was working around,

> this patch just replaces that ifdef with the correct check,

> i.e. __POSIX_VISIBLE >= 200809.

> ---

>  newlib/libc/include/string.h | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

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

> index 60e837bc0..32199c027 100644

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

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

> @@ -130,7 +130,7 @@ char	*strlwr (char *);

>  char	*strupr (char *);

>  #endif

>  

> -#ifndef DEFS_H	/* Kludge to work around problem compiling in gdb */

> +#if __POSIX_VISIBLE >= 200809

>  char	*strsignal (int __signo);

>  #endif

>  

> -- 

> 2.33.0.1079.g6e70778dc9-goog


Pushed.


Thanks,
Corinna

Patch

diff --git a/newlib/libc/include/string.h b/newlib/libc/include/string.h
index 60e837bc0..32199c027 100644
--- a/newlib/libc/include/string.h
+++ b/newlib/libc/include/string.h
@@ -130,7 +130,7 @@  char	*strlwr (char *);
 char	*strupr (char *);
 #endif
 
-#ifndef DEFS_H	/* Kludge to work around problem compiling in gdb */
+#if __POSIX_VISIBLE >= 200809
 char	*strsignal (int __signo);
 #endif