public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Clément Chigot" <chigot@adacore.com>
To: binutils@sourceware.org
Cc: nickc@redhat.com
Subject: Re: [PATCH] bfd: add missing include <time.h>
Date: Thu, 14 Mar 2024 13:46:44 +0100	[thread overview]
Message-ID: <CAJ307EjH-Pr4i0ktyxK0x5VKOvyZSyguR3tF6LdkT_JSzAfwNw@mail.gmail.com> (raw)
In-Reply-To: <20240313103728.1253706-1-chigot@adacore.com>

Hi Nick,

This patch looks trivial. Though, I'm wondering if binutils might
support some non-posix systems where this new include could trigger
issues. Do you think this could be the case ?

Clément

On Wed, Mar 13, 2024 at 11:37 AM Clément Chigot <chigot@adacore.com> wrote:
>
> 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
>

  reply	other threads:[~2024-03-14 12:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-13 10:37 Clément Chigot
2024-03-14 12:46 ` Clément Chigot [this message]
2024-03-15 15:39   ` Tom Tromey
2024-03-18 11:49     ` Nick Clifton
2024-03-18 11:49 ` Nick Clifton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJ307EjH-Pr4i0ktyxK0x5VKOvyZSyguR3tF6LdkT_JSzAfwNw@mail.gmail.com \
    --to=chigot@adacore.com \
    --cc=binutils@sourceware.org \
    --cc=nickc@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).