1. 09 10月, 2019 1 次提交
  2. 08 10月, 2019 1 次提交
  3. 07 10月, 2019 1 次提交
  4. 07 8月, 2019 1 次提交
  5. 22 2月, 2018 1 次提交
    • D
      m4: enforce that all enum cases are listed in switch statements · 67966ad5
      Daniel P. Berrangé 提交于
      As a general rule any time we switch() on something that is an enum, we
      want to have a case for every enum constant. The -Wswitch warning will
      report any switch where we've violated this rule, except if that switch
      has a default case.
      
      Unfortunately it is reasonable to want to list all enum constants *and*
      also have a default case. To get a warning in that scenario requires
      that we turn on -Wswitch-enum.
      
      In a few cases where we explicitly don't want to list all enum cases, we
      can discard the enum type checking by casting the value to a plain int.
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      67966ad5
  6. 16 2月, 2018 1 次提交
    • D
      m4: disable gcc8 -Wcast-function-type warnings from -Wextra · 91482930
      Daniel P. Berrangé 提交于
      The -Wextra flag bundle gained a new warning -Wcast-function-type.
      This complains if you cast between two function prototypes where
      the number of parameters or their data types are not compatible.
      Unfortunately we need such "bad" function casts for our event
      callbacks. It is possible to silence the warning by first casting
      to the generic "void (*)(void)" function prototype, but that is
      rather ugly to add throughout libvirt code.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      91482930
  7. 18 1月, 2018 1 次提交
    • J
      Raise the frame limit for tests · 33dd664c
      Ján Tomko 提交于
      After the latest CPU additions, the build fails with clang:
      cputest.c:905:1: error: stack frame size of 26136 bytes
        in function 'mymain' [-Werror,-Wframe-larger-than=]
      
      Raise the relaxed limit which is used for tests.
      33dd664c
  8. 06 9月, 2017 1 次提交
    • A
      m4: Disable -Wdisabled-optimization · fbe315bd
      Andrea Bolognani 提交于
      After b4f7793c, qemuxml2xmltest has apparently become big enough
      to trigger a compilation error when using --enable-test-coverage on
      aarch64:
      
          CC       qemuxml2xmltest.o
        qemuxml2xmltest.c: In function 'mymain':
        qemuxml2xmltest.c:1216:1: error: const/copy propagation disabled: 4361 basic blocks and 99285 registers [-Werror=disabled-optimization]
         }
         ^
        qemuxml2xmltest.c:1216:1: error: PRE disabled: 4361 basic blocks and 99285 registers [-Werror=disabled-optimization]
        qemuxml2xmltest.c:1216:1: error: const/copy propagation disabled: 4361 basic blocks and 99285 registers [-Werror=disabled-optimization]
        qemuxml2xmltest.c:1216:1: error: const/copy propagation disabled: 4361 basic blocks and 99285 registers [-Werror=disabled-optimization]
      
      However, as the GCC documentation states, this warning is not really
      caused by issues in our code, so it makes sense to disable it.
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      fbe315bd
  9. 28 8月, 2017 1 次提交
  10. 12 8月, 2017 1 次提交
  11. 15 6月, 2017 2 次提交
    • D
      Temporarily disable format truncation warnings · f1acc413
      Daniel P. Berrange 提交于
      GCC 7.1 introduces a new -Wformat-truncation warning
      flag that reports if it thinks the maximum possible
      size of the formatted output will exceed the provided
      fixed buffer. This is enabled automatically by the
      -Wformat warning flag. There are quite a few places
      hit by this in libvirt which need rewriting. This is
      non-trivial work in some places, so temporarily
      disable the new warning until those fixes can be
      implemented.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      f1acc413
    • D
      Disable the -Wduplicated-branches warning · 1ba69399
      Daniel P. Berrange 提交于
      Depending on the platform/architecture, a number of conditionals
      in libvirt code expand the same on both branches. This is expected
      behaviour and harmless, so disable the warning to avoid creating
      unexpected build failures
      
      Two examples, mingw32:
      
      ../../src/util/vircommand.c: In function 'virCommandWait':
      ../../src/util/vircommand.c:2562:51: error: this condition has identical branches [-Werror=duplicated-branches]
                   *exitstatus = cmd->rawStatus ? status : WEXITSTATUS(status);
                                                         ^
      and gcc7.1
      
      In file included from util/virobject.c:28:0:
      util/virobject.c: In function 'virClassNew':
      util/viratomic.h:176:46: error: this condition has identical branches [-Werror=duplicated-branches]
                  (void)(0 ? *(atomic) ^ *(atomic) : 0);                      \
                                                   ^
      util/virobject.c:144:20: note: in expansion of macro 'virAtomicIntInc'
          klass->magic = virAtomicIntInc(&magicCounter);
                         ^~~~~~~~~~~~~~~
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      1ba69399
  12. 06 4月, 2017 1 次提交
  13. 21 12月, 2016 1 次提交
  14. 11 4月, 2016 2 次提交
  15. 27 5月, 2015 1 次提交
    • E
      maint: update to latest gnulib · 3502f791
      Eric Blake 提交于
      Time to update to new gnulib before a release.
      
      gcc 5.1 introduced a new -Wformat-signedness, and new gnulib now
      turns it on by default.  However, it is still rather lame at the
      moment, because it warns for enums, even though there is no way
      to control the signeness of an enum which does not use any members
      that are negative or larger than INT_MAX, and even though such an
      enum would always print the same for both %d and %u:
      https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66249
      
      In file included from ../../src/util/virarch.c:26:0:
      ../../src/util/virarch.c: In function 'virArchFromHost':
      ../../src/util/virarch.c:180:15: error: format '%d' expects argument of type 'int', but argument 9 has type 'unsigned int' [-Werror=format=]
           VIR_DEBUG("Mapped %s to %d (%s)",
      
      So this patch turns off the new warning as part of enabling all
      other new gcc 5.1 warnings that gnulib now enables.
      
      * .gnulib: Update to latest, in part for gcc 5.1 interaction.
      * m4/virt-compile-warnings.m4: Ignore -Wformat-signedness, for now.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      3502f791
  16. 17 1月, 2015 1 次提交
  17. 12 6月, 2014 3 次提交
  18. 01 1月, 2014 1 次提交
  19. 26 11月, 2013 1 次提交
  20. 24 9月, 2013 1 次提交
    • E
      maint: update to latest gnulib · 21114ce9
      Eric Blake 提交于
      Since we're about to freeze, it's time to pick up the latest
      upstream gnulib.  Among other changes, gnulib now guarantees the
      use of some -f flags that we were previously manually adding.
      
      * .gnulib: Update to latest, in part for warning improvements.
      * m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS): Drop
      flags that are now guaranteed by gnulib.
      * bootstrap: Resync to gnulib.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      21114ce9
  21. 17 8月, 2013 1 次提交
    • E
      maint: slightly reduce configure size · 10ec6410
      Eric Blake 提交于
      Rather than inlining gl_WARN_ADD loads of time, we can shave about
      17k size off of the configure script by delaying it to a cleanup
      shell loop.
      
      * m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS): Track a
      list of things to check, rather than inlining multiple checks.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      10ec6410
  22. 07 8月, 2013 1 次提交
  23. 04 7月, 2013 2 次提交
    • J
      Fix build with clang · 4b91dc24
      Ján Tomko 提交于
      Partially revert cdd703f4's revert of c1634100, as linking with clang
      with --param=ssp-buffer-size=4 still fails with:
      "argument unused during compilation".
      4b91dc24
    • E
      maint: update to latest gnulib · cdd703f4
      Eric Blake 提交于
      The latest mingw headers on Fedora 19 fail to build with gnulib
      without an update.
      
      Meanwhile, now that upstream gnulib has better handling of -W
      probing for clang, we can drop some of our own solutions in
      favor of upstream; thus this reverts commit c1634100, "Correctly
      detect warning flags with clang".
      
      * .gnulib: Update to latest, for mingw and clang.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      cdd703f4
  24. 16 5月, 2013 1 次提交
    • R
      FreeBSD: disable buggy -fstack-protector-all · cc7cd623
      Roman Bogorodskiy 提交于
      FreeBSD ships an old gcc 4.2.1 which generates
      bogus code, e.g. getsockopt() call returns
      struct xucred with bogus values, which doesn't even
      allow to connect to libvirtd:
      
      error: Failed to find group record for gid '1284660778': No error: 0
      
      So roll back to just -fstack-protector on FreeBSD.
      cc7cd623
  25. 14 5月, 2013 3 次提交
  26. 08 4月, 2013 1 次提交
    • D
      Disable cast-align warnings in various places · e57aaa6f
      Daniel P. Berrange 提交于
      There are a number of places which generate cast alignment
      warnings, which are difficult or impossible to address. Use
      pragmas to disable the warnings in these few places
      
      conf/nwfilter_conf.c: In function 'virNWFilterRuleDetailsParse':
      conf/nwfilter_conf.c:1806:16: warning: cast increases required alignment of target type [-Wcast-align]
               item = (nwItemDesc *)((char *)nwf + att[idx].dataIdx);
      conf/nwfilter_conf.c: In function 'virNWFilterRuleDefDetailsFormat':
      conf/nwfilter_conf.c:3238:16: warning: cast increases required alignment of target type [-Wcast-align]
               item = (nwItemDesc *)((char *)def + att[i].dataIdx);
      
      storage/storage_backend_mpath.c: In function 'virStorageBackendCreateVols':
      storage/storage_backend_mpath.c:247:17: warning: cast increases required alignment of target type [-Wcast-align]
               names = (struct dm_names *)(((char *)names) + next);
      
      nwfilter/nwfilter_dhcpsnoop.c: In function 'virNWFilterSnoopDHCPDecode':
      nwfilter/nwfilter_dhcpsnoop.c:994:15: warning: cast increases required alignment of target type [-Wcast-align]
               pip = (struct iphdr *) pep->eh_data;
      nwfilter/nwfilter_dhcpsnoop.c:1004:11: warning: cast increases required alignment of target type [-Wcast-align]
           pup = (struct udphdr *) ((char *) pip + (pip->ihl << 2));
      
      nwfilter/nwfilter_learnipaddr.c: In function 'procDHCPOpts':
      nwfilter/nwfilter_learnipaddr.c:327:33: warning: cast increases required alignment of target type [-Wcast-align]
                       uint32_t *tmp = (uint32_t *)&dhcpopt->value;
      nwfilter/nwfilter_learnipaddr.c: In function 'learnIPAddressThread':
      nwfilter/nwfilter_learnipaddr.c:501:43: warning: cast increases required alignment of target type [-Wcast-align]
                           struct iphdr *iphdr = (struct iphdr*)(packet +
      nwfilter/nwfilter_learnipaddr.c:538:43: warning: cast increases required alignment of target type [-Wcast-align]
                           struct iphdr *iphdr = (struct iphdr*)(packet +
      nwfilter/nwfilter_learnipaddr.c:544:48: warning: cast increases required alignment of target type [-Wcast-align]
                               struct udphdr *udphdr= (struct udphdr *)
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      e57aaa6f
  27. 20 12月, 2012 1 次提交
    • E
      build: make broken -Wlogical-op test be gcc-only · 6e148567
      Eric Blake 提交于
      Commit 8b8fcdea introduced a check for broken gcc -Wlogical-op,
      but did not guard the check against non-gcc compilers, which might
      lead to spurious failures when another compiler encounters an
      unknown pragma.  Additionally, all of our compiler warning logic
      should belong in a single file, and use cache variables to allow
      overriding the decision at configure time if necessary.
      
      * configure.ac (BROKEN_GCC_WLOGICALOP): Move...
      * m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS): ...here,
      and update to modern autoconf idioms.
      6e148567
  28. 24 10月, 2012 1 次提交
  29. 02 10月, 2012 1 次提交
    • E
      build: avoid -Wno-format on new-enough gcc · 814a8dea
      Eric Blake 提交于
      Commit c579d6b3 added a sledgehammer to silence spurious warnings from
      gcc 4.2, but in the process, it also silenced useful warnings from
      gcc 4.3 through 4.5.  As a result, a bug slipped in to commit 0caccb58.
      
      Tested with FreeBSD (gcc 4.2.1), RHEL 6.3 (gcc 4.4), and F17 (gcc 4.7.2),
      where the former didn't trip on spurious warnings, and where the latter
      two detected a revert of 2b804cfa.
      
      * m4/virt-compile-warnings.m4 (-Wno-format): Probe for the actual
      spurious message, to once again allow gcc 4.4 to use -Wformat.
      814a8dea
  30. 08 9月, 2012 1 次提交
    • E
      build: fix build on older gcc · 89224251
      Eric Blake 提交于
      On RHEL 6.2, gcc 4.4.6 complains:
      cc1: warning: command line option "-Wenum-compare" is valid for C++/ObjC++ but not for C
      which in turn breaks a -Werror build.
      
      Meanwhile, in Fedora 17, gcc 4.7.0, -Wenum-compare has been enhanced
      to also work on C, but at the same time, it is documented that -Wall
      now implicitly includes -Wenum-compare.
      
      Therefore, it is sufficient to remove explicit checks for this option,
      avoiding the warning from older gcc while still getting the
      compile-time safety from newer gcc.
      
      * m4/virt-compile-warnings.m4 (-Wenum-compare): Omit explicit check.
      89224251
  31. 06 9月, 2012 1 次提交
    • E
      build: avoid warnings from gcc 4.2.1 · c579d6b3
      Eric Blake 提交于
      OpenBSD ships with gcc 4.2.1, which annoyingly treats all format
      strings as though they were also attribute((nonnull)).  The two
      concepts are orthogonal, though, as evidenced by the number of
      spurious warnings it generates on uses where we know that
      virReportError specifically handles NULL instead of a format
      string; worse, since we now force -Werror on git builds, it
      prevents development builds on OpenBSD.
      
      I hate to do this, as it disables ALL format checking on older
      gcc, and therefore misses out on some useful checks (code that
      happened to compile on Linux may still have type mismatches
      when compiled on other platforms, as evidenced by the number
      of times I have fixed formatting mismatches for uid_t as found
      by warnings on Cygwin), but I don't see any other way to keep
      -Werror alive and still compile on OpenBSD.
      
      A more invasive change would be to make virReportError() mark
      its format attribute as nonnull, and fix (a lot of) fallout;
      we may end up doing that anyways as part of danpb's error
      refactoring improvements, but not today.
      
      * src/internal.h (ATTRIBUTE_FMT_PRINTF): Use preferred spellings.
      * m4/virt-compile-warnings.m4 (-Wformat): Disable on older gcc.
      c579d6b3
  32. 16 8月, 2012 1 次提交
    • E
      build: avoid warnings on older gcc · 42af2167
      Eric Blake 提交于
      A previous patch (c606671a) pulled in a newer version of
      stat-time.h from gnulib, which causes some warnings in older gcc:
      
        CC     libvirt_driver_storage_la-storage_backend.lo
      cc1: warnings being treated as errors
      In file included from ../../src/storage/storage_backend.c:59:
      ../../gnulib/lib/stat-time.h:55: error: no previous prototype for 'get_stat_atime_ns' [-Wmissing-prototypes]
      
      Upstream gnulib argues that these warnings are stupid (and I agree;
      see <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>), and has
      used a modern gcc feature (#pragma GCC diagnostic push) to avoid the
      warning.  But we still aim to compile on RHEL 6.3, with gcc 4.4.6
      (not to mention even older platforms like RHEL 5), and therefore
      the warning trips up our default of development with -Werror.
      
      It took me a while to figure out how to make our set of warnings
      smaller on older gcc without losing the benefit of the warnings
      when using newer gcc (such as the one on Fedora 17), but this
      should do the trick.
      
      * m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS): Avoid
      warnings that gnulib can't silence on older gcc.
      42af2167
  33. 03 8月, 2012 1 次提交
    • H
      Added timestamps to storage volumes · 7383c1d7
      Hendrik Schwartke 提交于
      The access, birth, modification and change times are added to
      storage volumes and corresponding xml representations.  This
      shows up in the XML in this format:
      
      <timestamps>
        <atime>1341933637.027319099</atime>
        <mtime>1341933637.027319099</mtime>
      </timestamps>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      7383c1d7