public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] bfd: add missing include <time.h>
@ 2024-03-13 10:37 Clément Chigot
  2024-03-14 12:46 ` Clément Chigot
  2024-03-18 11:49 ` Nick Clifton
  0 siblings, 2 replies; 5+ messages in thread
From: Clément Chigot @ 2024-03-13 10:37 UTC (permalink / raw)
  To: binutils; +Cc: nickc, Clément Chigot

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.
---
 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 a335df522d2..eb58b674d25 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>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-18 11:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-13 10:37 [PATCH] bfd: add missing include <time.h> Clément Chigot
2024-03-14 12:46 ` Clément Chigot
2024-03-15 15:39   ` Tom Tromey
2024-03-18 11:49     ` Nick Clifton
2024-03-18 11:49 ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).