Add missing string.h

Message ID 20210329175056.389010-1-thomas@t-8ch.de
State New
Headers show
Series
  • Add missing string.h
Related show

Commit Message

Thomas Weißschuh March 29, 2021, 5:50 p.m.
This fixes compilation errors when compiling for riscv64-elf with gcc 10.2.0.

bfd/ChangeLog:

	* bfd-in.h: Add missing string.h
	* bfd-in2.h: Likewise
---
 bfd/bfd-in.h  | 1 +
 bfd/bfd-in2.h | 1 +
 2 files changed, 2 insertions(+)


base-commit: 9f67fc596b36ba46f31b2854655b5cbeffd91da9
-- 
2.31.1

Comments

Mike Frysinger via Gdb-patches March 29, 2021, 7:59 p.m. | #1
Hi,

On 3/29/21 2:50 PM, Thomas Weißschuh wrote:
> This fixes compilation errors when compiling for riscv64-elf with gcc 10.2.0.


Alan Modra has a proposed patch for this, see here: 
https://sourceware.org/pipermail/gdb-patches/2021-March/177079.html

It is a bigger problem and not riscv-specific.

> 

> bfd/ChangeLog:

> 

> 	* bfd-in.h: Add missing string.h

> 	* bfd-in2.h: Likewise

> ---

>   bfd/bfd-in.h  | 1 +

>   bfd/bfd-in2.h | 1 +

>   2 files changed, 2 insertions(+)

> 

> diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h

> index fda9fe0198e..dfa0ad8007f 100644

> --- a/bfd/bfd-in.h

> +++ b/bfd/bfd-in.h

> @@ -37,6 +37,7 @@ extern "C" {

>   #include "bfd_stdint.h"

>   #include "diagnostics.h"

>   #include <stdarg.h>

> +#include <string.h>

>   #include <sys/stat.h>

>   

>   #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)

> diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h

> index 8874da88afd..585f8eb0677 100644

> --- a/bfd/bfd-in2.h

> +++ b/bfd/bfd-in2.h

> @@ -44,6 +44,7 @@ extern "C" {

>   #include "bfd_stdint.h"

>   #include "diagnostics.h"

>   #include <stdarg.h>

> +#include <string.h>

>   #include <sys/stat.h>

>   

>   #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)

> 

> base-commit: 9f67fc596b36ba46f31b2854655b5cbeffd91da9

>

Patch

diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index fda9fe0198e..dfa0ad8007f 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -37,6 +37,7 @@  extern "C" {
 #include "bfd_stdint.h"
 #include "diagnostics.h"
 #include <stdarg.h>
+#include <string.h>
 #include <sys/stat.h>
 
 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 8874da88afd..585f8eb0677 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -44,6 +44,7 @@  extern "C" {
 #include "bfd_stdint.h"
 #include "diagnostics.h"
 #include <stdarg.h>
+#include <string.h>
 #include <sys/stat.h>
 
 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)