From: Carlos O'Donell <codonell-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Elichai Turkel
<elichai.turkel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Including both linux/time.h and linux/input.h causes failure
Date: Wed, 29 Jan 2020 12:16:26 -0500 [thread overview]
Message-ID: <88ab5e38-254a-430d-67cf-1840b0e51c35@redhat.com> (raw)
In-Reply-To: <CALN7hC+f+D8xsaJBt+MCXDfk51oHCoQeUVmFydNdkW+_DeqTiw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On 1/29/20 10:14 AM, Elichai Turkel wrote:
> Hi,
> The following header: <wrapper.h>:
> ```
> #include <linux/input.h>
> #include <linux/time.h>
> ```
> Will cause the compiler to fail because of redefinition of a lot of
> time related structs, that are declared once in `linux/time.h` and
> then again via `bits/types/struct_timeval.h` which is included through
> `linux/input.h > sys/time.h -> bits/types/struct_timeval.h`
This is another header-coordination issue between the kernel and libc.
In this case it's linux/time.h vs. sys/time.h.
"Synchronizing Headers"
https://sourceware.org/glibc/wiki/Synchronizing_Headers
- Just added your case.
It's not immediate clear to me if the UAPI header is clean enough to
use directly in glibc or not, and that's often the simplest way to fix
things.
When you can't just use the kernel header definitions then you have
to work through the conflict and decide if you want to allow both headers
to be potentially included and in which orders to support it.
Why do you need both headers included?
--
Cheers,
Carlos.
next prev parent reply other threads:[~2020-01-29 17:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-29 15:14 Including both linux/time.h and linux/input.h causes failure Elichai Turkel
[not found] ` <CALN7hC+f+D8xsaJBt+MCXDfk51oHCoQeUVmFydNdkW+_DeqTiw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-01-29 17:16 ` Carlos O'Donell [this message]
[not found] ` <88ab5e38-254a-430d-67cf-1840b0e51c35-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2020-01-30 14:12 ` Elichai Turkel
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=88ab5e38-254a-430d-67cf-1840b0e51c35@redhat.com \
--to=codonell-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=elichai.turkel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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 NNTP newsgroup(s).