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

Re: [Xen-devel] Errors of doing "make install-tools" with xen-4.2-unstable?


  • To: Bei Guan <gbtju85@xxxxxxxxx>, Ian Campbell <Ian.Campbell@xxxxxxxxxx>
  • From: Keir Fraser <keir@xxxxxxx>
  • Date: Fri, 11 May 2012 17:47:05 +0100
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxx>
  • Delivery-date: Fri, 11 May 2012 16:47:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: Ac0vlbI0xEAt/6MFzUysUP6/JofztQ==
  • Thread-topic: [Xen-devel] Errors of doing "make install-tools" with xen-4.2-unstable?

On 11/05/2012 17:33, "Bei Guan" <gbtju85@xxxxxxxxx> wrote:

> 2012/5/12 Ian Campbell <Ian.Campbell@xxxxxxxxxx>
>> On Fri, 2012-05-11 at 17:10 +0100, Bei Guan wrote:
>> 
>> 
>>> No, it doesn't work for me. There is the same error.
>> 
>> Hrm. Since you can reproduce would you mind experimenting a bit to
>> figure out the correct fix for this?
>> 
>> Perhaps adding -Wno-unused-result to C flags helps (google suggests it
>> may not)?
> Yes, I add this option to Makefile. And now it works well. The patch is as the
> following. Thank you very much.

I'd be worried about more command-line meddling causing even more fallout.
Particularly because we haven't used that option anywhere else so far, so
it's untested by us. E.g., do all gcc support -Wno-unused-result?

 -- Keir

> 
> diff -r 54c8c9eaee92 tools/blktap2/drivers/Makefile
> --- a/tools/blktap2/drivers/Makefile    Fri Apr 27 11:09:26 2012 +0200
> +++ b/tools/blktap2/drivers/Makefile    Sat May 12 00:31:12 2012 +0800
> @@ -11,6 +11,7 @@
>  
>  CFLAGS    += -Werror -g
>  CFLAGS    += -Wno-unused
> +CFLAGS    += -Wno-unused-result
>  CFLAGS    += -fno-strict-aliasing
>  CFLAGS    += -I$(BLKTAP_ROOT)/include -I$(BLKTAP_ROOT)/drivers
>  CFLAGS    += $(CFLAGS_libxenctrl)
> 
> 
> 
> 
> Thanks,
> Bei Guan
> 
> 
> 
>  
>> 
>> Or maybe just assigning to a dummy variable.
>> 
>> Ian.
>> 
>>> My environment and gcc version are like this:
>>> 
>>> root@gavin-desktop:~# uname -a
>>> Linux gavin-desktop 2.6.32-5-xen-amd64 #1 SMP Thu May 19 01:16:47 UTC
>>> 2011 x86_64 GNU/Linux
>>> 
>>> root@gavin-desktop:~# gcc -v
>>> Using built-in specs.
>>> Target: x86_64-linux-gnu
>>> Configured with: ../src/configure -v --with-pkgversion='Ubuntu
>>> 4.4.3-4ubuntu5'
>>> --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
>>> --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
>>> --enable-shared --enable-multiarch --enable-linker-build-id
>>> --with-system-zlib --libexecdir=/usr/lib --without-included-gettext
>>> --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4
>>> --program-suffix=-4.4 --enable-nls --enable-clocale=gnu
>>> --enable-libstdcxx-debug --enable-plugin --enable-objc-gc
>>> --disable-werror --with-arch-32=i486 --with-tune=generic
>>> --enable-checking=release --build=x86_64-linux-gnu
>>> --host=x86_64-linux-gnu --target=x86_64-linux-gnu
>>> Thread model: posix
>>> gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)
>>> 
>>> 
>>> 
>>> 
>>> Thanks,
>>> Bei Guan
>>> 
>>> 
>>> 
>>> 
>>> 
>>>         8<------------------------------------------------------
>>> 
>>>         # HG changeset patch
>>>         # User Ian Campbell <ian.campbell@xxxxxxxxxx>
>>>         # Date 1336751175 -3600
>>>         # Node ID 15ed8f45c4e57a1e206af020e0ff17b792108e99
>>>         # Parent  adc74e492edfee6cf44e433e3e93743a3cf71999
>>>         blktap: avoid attribute warn_unused_result build failures.
>>> 
>>>         I'm not proud of this, but since none of these callers of
>>>         read/write have any
>>>         other error handling and return void themselves (for several
>>>         links up the call
>>>         chain AFAICT) and because I don't really want to get into a
>>>         massive reworking
>>>         of blktap2 I suppose it is at least pragmatic
>>> 
>>>         Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
>>> 
>>>         diff -r adc74e492edf -r 15ed8f45c4e5
>>>         tools/blktap2/drivers/tapdisk-log.c
>>>         --- a/tools/blktap2/drivers/tapdisk-log.c       Fri May 11
>>>         16:19:16 2012 +0100
>>>         +++ b/tools/blktap2/drivers/tapdisk-log.c       Fri May 11
>>>         16:46:15 2012 +0100
>>>         @@ -247,7 +247,7 @@ tlog_flush(void)
>>>                wsize = ((size + 511) & (~511));
>>> 
>>>                memset(tapdisk_log.buf + size, '\n', wsize - size);
>>>         -       write(fd, tapdisk_log.buf, wsize);
>>>         +       (void)write(fd, tapdisk_log.buf, wsize);
>>> 
>>>                tapdisk_log.p = tapdisk_log.buf;
>>> 
>>>         diff -r adc74e492edf -r 15ed8f45c4e5
>>>         tools/blktap2/drivers/tapdisk-queue.c
>>>         --- a/tools/blktap2/drivers/tapdisk-queue.c     Fri May 11
>>>         16:19:16 2012 +0100
>>>         +++ b/tools/blktap2/drivers/tapdisk-queue.c     Fri May 11
>>>         16:46:15 2012 +0100
>>>         @@ -435,7 +435,7 @@ tapdisk_lio_ack_event(struct tqueue *que
>>>                uint64_t val;
>>> 
>>>                if (lio->flags & LIO_FLAG_EVENTFD)
>>>         -               read(lio->event_fd, &val, sizeof(val));
>>>         +               (void)read(lio->event_fd, &val, sizeof(val));
>>>          }
>>> 
>>>          static void
>>>         diff -r adc74e492edf -r 15ed8f45c4e5
>>>         tools/blktap2/drivers/tapdisk-stream.c
>>>         --- a/tools/blktap2/drivers/tapdisk-stream.c    Fri May 11
>>>         16:19:16 2012 +0100
>>>         +++ b/tools/blktap2/drivers/tapdisk-stream.c    Fri May 11
>>>         16:46:15 2012 +0100
>>>         @@ -145,7 +145,7 @@ tapdisk_stream_poll_clear(struct tapdisk
>>>          {
>>>                int dummy;
>>> 
>>>         -       read(p->pipe[POLL_READ], &dummy, sizeof(dummy));
>>>         +       (void)read(p->pipe[POLL_READ], &dummy, sizeof(dummy));
>>>                p->set = 0;
>>>          }
>>> 
>>>         @@ -155,7 +155,7 @@ tapdisk_stream_poll_set(struct tapdisk_s
>>>                int dummy = 0;
>>> 
>>>                if (!p->set) {
>>>         -               write(p->pipe[POLL_WRITE], &dummy,
>>>         sizeof(dummy));
>>>         +               (void)write(p->pipe[POLL_WRITE], &dummy,
>>>         sizeof(dummy));
>>>                        p->set = 1;
>>>                }
>>>          }
>>>         @@ -203,7 +203,7 @@ tapdisk_stream_print_request(struct tapd
>>>          {
>>>                unsigned long idx = (unsigned
>>>         long)tapdisk_stream_request_idx(s, sreq);
>>>                char *buf = (char *)MMAP_VADDR(s->vbd->ring.vstart,
>>>         idx, 0);
>>>         -       write(s->out_fd, buf, sreq->secs << SECTOR_SHIFT);
>>>         +       (void)write(s->out_fd, buf, sreq->secs <<
>>>         SECTOR_SHIFT);
>>>          }
>>> 
>>>          static void
>>>         diff -r adc74e492edf -r 15ed8f45c4e5
>>>         tools/blktap2/drivers/tapdisk2.c
>>>         --- a/tools/blktap2/drivers/tapdisk2.c  Fri May 11 16:19:16
>>>         2012 +0100
>>>         +++ b/tools/blktap2/drivers/tapdisk2.c  Fri May 11 16:46:15
>>>         2012 +0100
>>>         @@ -79,7 +79,12 @@ main(int argc, char *argv[])
>>>                if (optind != argc)
>>>                        usage(argv[0], EINVAL);
>>> 
>>>         -       chdir("/");
>>>         +       if (chdir("/")) {
>>>         +               DPRINTF("failed to chdir(/): %d\n", errno);
>>>         +               err = 1;
>>>         +               goto out;
>>>         +       }
>>>         +
>>>                tapdisk_start_logging("tapdisk2");
>>> 
>>>                err = tapdisk_server_init();
>>> 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> Best Regards,
>>> Bei Guan
>>> 
>> 
>> 
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.