All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Christopher Covington <cov@codeaurora.org>, qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@gmail.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3] build: include sys/sysmacros.h for major() and minor()
Date: Thu, 29 Dec 2016 08:03:41 -0600	[thread overview]
Message-ID: <db6c1fd9-16ac-7670-0fe3-966139864a23@redhat.com> (raw)
In-Reply-To: <20161228200433.24244-1-cov@codeaurora.org>

[-- Attachment #1: Type: text/plain, Size: 2369 bytes --]

On 12/28/2016 02:04 PM, Christopher Covington wrote:

It's best when posting a v3 to do so as a new thread, rather than buried
in-reply-to an earlier thread, as some maintainers' tools overlook
deeply-threaded patches.  Probably won't matter too much in this case,
but it's useful information for future submissions; other tips can be
found here:
http://wiki.qemu.org/Contribute/SubmitAPatch


> The definition of the major() and minor() macros are moving within glibc to
> <sys/sysmacros.h>.

Or more precisely, major() and minor() have ALWAYS been in
<sys/sysmacros.h> under glibc, but are now being removed from
<sys/types.h>.  But your patch is the correct fix: if <sys/sysmacros.h>
exists, include it.

> Include this header when it is available to avoid the
> following sorts of build-stopping messages:
> 
> qga/commands-posix.c: In function ‘dev_major_minor’:
> 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);
>              ^~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> qga/commands-posix.c:657:13: error: In the GNU C Library, "minor" 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 "minor", include <sys/sysmacros.h>
>  directly. If you did not intend to use a system-defined macro
>  "minor", you should undefine it after including <sys/types.h>. [-Werror]
>          *devminor = minor(st.st_rdev);
>              ^~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> The additional include allows the build to complete on Fedora 26 (Rawhide)
> with glibc version 2.24.90.
> 
> Signed-off-by: Christopher Covington <cov@codeaurora.org>
> ---
>  configure                 | 18 ++++++++++++++++++
>  include/sysemu/os-posix.h |  4 ++++
>  2 files changed, 22 insertions(+)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
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 --]

  reply	other threads:[~2016-12-29 14:03 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
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 [this message]
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=db6c1fd9-16ac-7670-0fe3-966139864a23@redhat.com \
    --to=eblake@redhat.com \
    --cc=cov@codeaurora.org \
    --cc=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 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.