[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [Qemu-devel] [PATCH 0/1] major / minor macros are to

From: Eric Blake
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH 0/1] major / minor macros are to be included from <sys/sysmacros.h>
Date: Tue, 14 Mar 2017 08:37:31 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

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: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]