[binutils-gdb] bfd: add missing include <time.h>

Cl?ment Chigot helflym@sourceware.org
Mon Mar 18 11:54:02 GMT 2024


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d0eb2625bff1387744304bdc70ec0a85a20b8a3f

commit d0eb2625bff1387744304bdc70ec0a85a20b8a3f
Author: Clément Chigot <chigot@adacore.com>
Date:   Wed Mar 13 11:05:01 2024 +0100

    bfd: add missing include <time.h>
    
    bdfio.c is defining bfd_get_current_time which is returning a time_t.
    This type is defined in time.h and thus, must be included in bfd main
    header to avoid undefined type when include bfd.h.
    
    Note that most of the time, <time.h> is pulled by <sys/stat.h> already
    included in bfd.h. That's why it went unnoticed.

Diff:
---
 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 0ff1e2f3ed5..04e65aad5f0 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -36,6 +36,7 @@ extern "C" {
 #include "symcat.h"
 #include <stdint.h>
 #include <stdbool.h>
+#include <time.h>
 #include "diagnostics.h"
 #include <stdarg.h>
 #include <string.h>
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 29602e054da..fa28688837c 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -44,6 +44,7 @@ extern "C" {
 #include "symcat.h"
 #include <stdint.h>
 #include <stdbool.h>
+#include <time.h>
 #include "diagnostics.h"
 #include <stdarg.h>
 #include <string.h>


More information about the Binutils-cvs mailing list