1. 12 8月, 2017 1 次提交
  2. 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
  3. 06 4月, 2017 1 次提交
  4. 21 12月, 2016 1 次提交
  5. 11 4月, 2016 2 次提交
  6. 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
  7. 17 1月, 2015 1 次提交
  8. 12 6月, 2014 3 次提交
  9. 01 1月, 2014 1 次提交
  10. 26 11月, 2013 1 次提交
  11. 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
  12. 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
  13. 07 8月, 2013 1 次提交
  14. 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
  15. 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
  16. 14 5月, 2013 3 次提交
  17. 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
  18. 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
  19. 24 10月, 2012 1 次提交
  20. 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
  21. 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
  22. 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
  23. 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
  24. 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
  25. 08 6月, 2012 1 次提交
    • E
      maint: make it easier to copy FORTIFY_SOURCE snippet · 1c2edf0f
      Eric Blake 提交于
      While libvirt intentionally avoids -Wundef (after all, C99
      guarantees sane semantics of treating undefined macros as 0),
      the glibc insanity of #warning on _FORTIFY_SOURCE coupled with
      what some people feel is the black magic of autoconf means
      that other projects are likely to copy our snippet verbatim.
      We can be nicer to other projects by making it easier to
      integrate into projects that use -Wundef.
      
      Suggested by Christophe Fergeau.
      
      * m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS): Be nice
      to other projects using -Wundef.
      1c2edf0f
  26. 05 6月, 2012 1 次提交
    • E
      build: allow building with newer glibc-headers and -O0 · 2af63b1c
      Eric Blake 提交于
      glibc 2.15 (on Fedora 17) coupled with explicit disabling of
      optimization during development dies a painful death:
      
      In file included from /usr/include/limits.h:27:0,
                       from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/limits.h:169,
                       from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/syslimits.h:7,
                       from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/limits.h:34,
                       from util/bitmap.c:26:
      /usr/include/features.h:314:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
      cc1: all warnings being treated as errors
      
      Work around this by only conditionally defining _FORTIFY_SOURCE,
      in the case where glibc can actually use it.  The trick is using
      AH_VERBATIM instead of AC_DEFINE.
      
      * m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS): Squelch
      _FORTIFY_SOURCE when needed to avoid glibc #warnings.
      2af63b1c
  27. 28 3月, 2012 1 次提交
    • D
      Enable all warnings permanently & default to -Werror for GIT builds · 851117bd
      Daniel P. Berrange 提交于
      Given that we auto-detect whether each -Wxxxx flag is supported by
      GCC, and we are warning-free and use automake silent rules, there
      is no compelling reason to allow compile warnings to be disabled.
      
      Replace the --enable-compile-warnings flag with a simpler
      --enable-werror flag, which defaults to 'yes' if building
      from GIT, or 'no' if building from tar.gz
      
      This helps ensure that everyone writing patches for libvirt will
      take care to fix their warning problems before submitting for
      review
      
      * autobuild.sh: Force -Werror
      * configure.ac: Update for LIBVIRT_COMPILE_WARNINGS macro change
      * m4/virt-compile-warnings.m4: Permanently enable all warnings,
        auto-enable Werror for GIT builds
      851117bd
  28. 20 1月, 2012 1 次提交
    • E
      build: silence some compiler warnings from gnulib · d940e3bd
      Eric Blake 提交于
      Gnulib claims that there are some classes of warnings that are
      worth enabling during development, but where silencing those
      warnings causes code bloat that is not necessary in an optimized
      build.  The code bloat to silence the warnings is only enabled
      by -Dlint.  Follow the lead of coreutils in setting up -Dlint
      whenever full warnings are requested.
      
      * m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS): Add
      -Dlint, and move _FORTIFY_SOURCE to config.h instead of CFLAGS.
      d940e3bd
  29. 06 12月, 2011 1 次提交
    • E
      build: reduce warnings from older gcc · f17e0e21
      Eric Blake 提交于
      Older gcc warns (on every file!) that -Wabi and -Wdeprecated only
      make sense on C++ projects.  Newer gcc accepts these warnings for
      C, but it is not clear that they can do anything useful, so it
      is easier to just drop the warnings altogether.
      
      * m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS): Silence
      -Wabi and -Wdeprecated on older gcc.
      Reported by Peter Krempa.
      f17e0e21
  30. 03 12月, 2011 1 次提交
    • E
      build: fix build at -O2 on rawhide · 75da3200
      Eric Blake 提交于
      I had previously tested commit 059d746d with -O intentionally omitted
      from my CFLAGS; but that means that I missed out on this warning
      from gcc 4.6.2 when optimizations are enabled:
      
      util/buf.c: In function 'virBufferGetIndent':
      util/buf.c:86:1: error: function might be candidate for attribute 'pure' [-Werror=suggest-attribute=pure]
      
      While it is probably a good idea to add the attributes and silence
      this warning, it's also invasive; 'make -k' found more than 75 such
      complaints.  And it doesn't help that gcc 4.6.2 is still buggy
      (coreutils reported a case where gcc 4.6.2 incorrectly suggested
      marking a function pure that incremented a global variable; fixed
      in gcc 4.7).  So the best fix for now is to disable the warning.
      
      It also doesn't help that I stumbled across another problem - gcc
      documents that -Wsuggest-attribute=pure only warns if you use -O,
      or if you use -fipa-pure-const.  But in practice, when I omitted -O
      but added -fipa-pure-const, the warnings are fickle - I got warnings
      for simple compilation that disappeared when I also added -fPIC.
      And the way libtool compiles things is with -fPIC first, then without
      -fPIC but with errors sent to /dev/null - which meant that without
      disabling -Wsuggest-attribute=pure, I got a compile error with no
      message.  :(  See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10197
      
      * m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS): Silence
      -Wsuggest-attribute warnings for now.
      75da3200
  31. 02 12月, 2011 1 次提交
    • E
      build: update to latest gnulib · 059d746d
      Eric Blake 提交于
      * .gnulib: Update to latest, for improved 'make syntax-check' and
      compiler warnings.
      * m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS):
      Re-silence -Wformat-nonliteral.
      * cfg.mk (_test_script_regex): Recognize our test scripts.
      * gnulib/local/lib/*.diff: Drop, now that gnulib has this.
      * tests/virsh-optparse: Fix use of compare.
      * tests/virsh-schedinfo: Likewise.
      059d746d
  32. 01 5月, 2011 1 次提交
    • M
      tests: Lower stack usage below 4096 bytes · 9ba4eb3c
      Matthias Bolte 提交于
      Make virtTestLoadFile allocate the buffer to read the file into.
      
      Fix logic error in virtTestLoadFile, stop reading on the first empty line.
      
      Use virFileReadLimFD in virtTestCaptureProgramOutput to avoid manual
      buffer handling.
      9ba4eb3c
  33. 08 4月, 2011 1 次提交
    • E
      build: fix gitignore sorting · 02c39a2f
      Eric Blake 提交于
      Make it so we don't have to 'git add -f' particular files like
      po/POTFILES.in all the time (tested by fixing one of our
      special-case files as part of the patch).
      
      * .gnulib: Update to latest.
      * bootstrap: Resync from coreutils.
      * .gitignore: Sort whitelist entries correctly, including ignoring
      files rather than directories.
      * m4/virt-compile-warnings.m4: Convert tabs to space.
      02c39a2f