From: "Marc-André Lureau" <marcandre.lureau@gmail.com>
To: "Radim Krčmář" <rkrcmar@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] build: handle deprecation of major() in sys/types.h
Date: Thu, 22 Sep 2016 21:09:06 +0000 [thread overview]
Message-ID: <CAJ+F1CJXGAZa5_+4jD0rP_zX28RCCu3xmF27ZHpgvhnZz686ug@mail.gmail.com> (raw)
In-Reply-To: <20160922205647.18237-1-rkrcmar@redhat.com>
Hi
On Fri, Sep 23, 2016 at 12:58 AM Radim Krčmář <rkrcmar@redhat.com> wrote:
> GCC 6.2.1 stops the build of qga/commands-posix.c with:
>
>
It would not be only qga, but at least:
hw/9pfs/9p.c: major(stbuf->st_rdev), minor(stbuf->st_rdev));
linux-user/strace.c: print_raw_param("makedev(%d", major(arg2), 0);
linux-user/strace.c: print_raw_param("makedev(%d", major(arg3), 0);
qga/commands-posix.c: *devmajor = major(st.st_rdev);
In the GNU C Library, `major' is defined by <sys/sysmacros.h>.
> For historical compatibility, it is currently defined by
> <sys/types.h> as well, but we plan to remove this soon.
>
> To use `major', include <sys/sysmacros.h> directly.
> If you did not intend to use a system-defined macro `major',
> you should #undef it after including <sys/types.h>.
>
> Include <sys/sysmacros.h> for all users of <sys/types.h>.
>
> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
> ---
> include/qemu/osdep.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
> index 9e9fa6154642..fad31c3d5b56 100644
> --- a/include/qemu/osdep.h
> +++ b/include/qemu/osdep.h
> @@ -64,6 +64,7 @@ extern int daemon(int, int);
> #include <stdbool.h>
> #include <stdint.h>
> #include <sys/types.h>
> +#include <sys/sysmacros.h>
>
I doubt this will work with mingw (I didn't try, but it is not in my mingw
prefix), perhaps better in include/sysemu/os-posix.h?
> #include <stdlib.h>
> #include <stdio.h>
> #include <string.h>
> --
> 2.10.0
>
>
> --
Marc-André Lureau
next prev parent reply other threads:[~2016-09-22 21:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-22 20:56 [Qemu-devel] [PATCH] build: handle deprecation of major() in sys/types.h Radim Krčmář
2016-09-22 21:09 ` Marc-André Lureau [this message]
2016-12-28 14:53 ` [Qemu-devel] [PATCH v2] build: include sys/sysmacros.h for major() and minor() Christopher Covington
2016-12-28 16:10 ` Eric Blake
2016-12-28 17:07 ` Peter Maydell
2016-12-29 13:48 ` Eric Blake
2016-12-30 11:35 ` Peter Maydell
2016-12-28 20:03 ` Christopher Covington
2016-12-28 20:04 ` [Qemu-devel] [PATCH v3] " Christopher Covington
2016-12-29 14:03 ` Eric Blake
2017-03-13 18:31 ` Eric Blake
2017-03-14 10:12 ` Peter Maydell
2016-09-22 21:09 ` [Qemu-devel] [PATCH] build: handle deprecation of major() in sys/types.h Eric Blake
2016-09-22 21:10 ` no-reply
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=CAJ+F1CJXGAZa5_+4jD0rP_zX28RCCu3xmF27ZHpgvhnZz686ug@mail.gmail.com \
--to=marcandre.lureau@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=rkrcmar@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 NNTP newsgroup(s).