* [Qemu-devel] [PATCH 0/1] major / minor macros are to be included from <sys/sysmacros.h>
@ 2017-03-14 10:19 Andreas Grapentin
2017-03-14 10:19 ` [Qemu-devel] [PATCH 1/1] " Andreas Grapentin
2017-03-14 13:37 ` [Qemu-devel] [PATCH 0/1] " Eric Blake
0 siblings, 2 replies; 3+ messages in thread
From: Andreas Grapentin @ 2017-03-14 10:19 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Andreas Grapentin
Building qemu fails with glibc-2.25 and gcc-6.3.1:
> qemu/qga/commands-posix.c:656:13: error: 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 undefine it after including <sys/types.h>. [-Werror]
> *devmajor = major(st.st_rdev);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~
A trivial fix is to #include <sys/sysmacros.h> in the respective files.
Andreas Grapentin (1):
major / minor macros are to be included from <sys/sysmacros.h>
hw/9pfs/9p.c | 1 +
qga/commands-posix.c | 1 +
2 files changed, 2 insertions(+)
--
2.12.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] [PATCH 1/1] major / minor macros are to be included from <sys/sysmacros.h>
2017-03-14 10:19 [Qemu-devel] [PATCH 0/1] major / minor macros are to be included from <sys/sysmacros.h> Andreas Grapentin
@ 2017-03-14 10:19 ` Andreas Grapentin
2017-03-14 13:37 ` [Qemu-devel] [PATCH 0/1] " Eric Blake
1 sibling, 0 replies; 3+ messages in thread
From: Andreas Grapentin @ 2017-03-14 10:19 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Andreas Grapentin
---
hw/9pfs/9p.c | 1 +
qga/commands-posix.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index 76c9247c77..d9cfa8900e 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -12,6 +12,7 @@
*/
#include "qemu/osdep.h"
+#include <sys/sysmacros.h>
#include <glib/gprintf.h>
#include "hw/virtio/virtio.h"
#include "qapi/error.h"
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 73d93eb5ce..9eecdd092c 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -14,6 +14,7 @@
#include "qemu/osdep.h"
#include <sys/ioctl.h>
#include <sys/wait.h>
+#include <sys/sysmacros.h>
#include <dirent.h>
#include "qga/guest-agent-core.h"
#include "qga-qmp-commands.h"
--
2.12.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH 0/1] major / minor macros are to be included from <sys/sysmacros.h>
2017-03-14 10:19 [Qemu-devel] [PATCH 0/1] major / minor macros are to be included from <sys/sysmacros.h> Andreas Grapentin
2017-03-14 10:19 ` [Qemu-devel] [PATCH 1/1] " Andreas Grapentin
@ 2017-03-14 13:37 ` Eric Blake
1 sibling, 0 replies; 3+ messages in thread
From: Eric Blake @ 2017-03-14 13:37 UTC (permalink / raw)
To: Andreas Grapentin, qemu-devel; +Cc: qemu-trivial
[-- Attachment #1: Type: text/plain, Size: 1119 bytes --]
On 03/14/2017 05:19 AM, Andreas Grapentin wrote:
> Building qemu fails with glibc-2.25 and gcc-6.3.1:
>
>> qemu/qga/commands-posix.c:656:13: error: 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 undefine it after including <sys/types.h>. [-Werror]
>> *devmajor = major(st.st_rdev);
>> ^~~~~~~~~~~~~~~~~~~~~~~~~~
>
> A trivial fix is to #include <sys/sysmacros.h> in the respective files.
>
>
> Andreas Grapentin (1):
> major / minor macros are to be included from <sys/sysmacros.h>
NACK. <sys/sysmacros.h> is not a universal file, so you can't blindly
include it without first checking that it exists. We already fixed the
problem correctly in commit 4d04351, which just landed today.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-03-14 13:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-14 10:19 [Qemu-devel] [PATCH 0/1] major / minor macros are to be included from <sys/sysmacros.h> Andreas Grapentin
2017-03-14 10:19 ` [Qemu-devel] [PATCH 1/1] " Andreas Grapentin
2017-03-14 13:37 ` [Qemu-devel] [PATCH 0/1] " Eric Blake
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.