qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Hacks for building on gcc 7 / Fedora 26


From: Eric Blake
Subject: Re: [Qemu-devel] Hacks for building on gcc 7 / Fedora 26
Date: Mon, 17 Jul 2017 08:48:08 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 07/17/2017 08:42 AM, Eric Blake wrote:
> On 07/13/2017 08:07 AM, Philippe Mathieu-Daudé wrote:
>> On 04/07/2017 04:21 PM, Philippe Mathieu-Daudé wrote:
>>> Hi Dave,
>>>
>>> On 04/07/2017 11:38 AM, Dr. David Alan Gilbert wrote:
>>>> Hi,
>>>>    Fedora 26 has gcc 7.0.1 which has the normal compliment
>>>> of new fussy warnings; so far I've posted :
>>>>
>>>> tests/check-qdict: Fix missing brackets
>>>> slirp/smb: Replace constant strings by glib string
>>>>
>>>> that fix one actual mistake and work around something it's being
>>>> fussy over.
>>>>
>>>> But I've also got a pile of hacks, attached below that I'm
>>>> not too sure what I'll do with them yet, but they're attached
>>
>> ping ... What do we do with them?
> 
> Well, now that I've upgraded to the just-released Fedora 26, it is now
> mainline gcc and affecting my builds.  So we should really try and find
> patches that silence the warnings (although it counts as bug fixes, so
> it won't hurt if it doesn't make tomorrow's freeze deadline).

FWIW, most of these have been fixed in the meantime; the only remaining
hack I had to add was:

diff --git i/hw/usb/bus.c w/hw/usb/bus.c
index 5939b273b9..bce011058b 100644
--- i/hw/usb/bus.c
+++ w/hw/usb/bus.c
@@ -407,8 +407,9 @@ void usb_register_companion(const char *masterbus,
USBPort *ports[],
 void usb_port_location(USBPort *downstream, USBPort *upstream, int portnr)
 {
     if (upstream) {
-        snprintf(downstream->path, sizeof(downstream->path), "%s.%d",
-                 upstream->path, portnr);
+        int l = snprintf(downstream->path, sizeof(downstream->path),
"%s.%d",
+                         upstream->path, portnr);
+        assert(l < sizeof(downstream->path));
         downstream->hubcount = upstream->hubcount + 1;
     } else {
         snprintf(downstream->path, sizeof(downstream->path), "%d", portnr);

Gerd, MAINTAINERS lists you; can you come up with something more robust?

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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