- 12 8月, 2017 1 次提交
-
-
由 Daniel P. Berrange 提交于
When building libvirt with clang we get bogus warnings about 'double' being promoted to 'long double' when calling isnan(). https://bugzilla.redhat.com/show_bug.cgi?id=1472437 Detect this broken isnan() / compiler combination and disable the -Wdouble-promotion flag. Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 15 6月, 2017 2 次提交
-
-
由 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>
-
由 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>
-
- 06 4月, 2017 1 次提交
-
-
由 Ján Tomko 提交于
Introduce STRICT_FRAME_LIMIT_CFLAGS that will be used for production code and RELAXED_FRAME_LIMIT_CFLAGS for tests. Raising the limit for tests allows building them with clang with optimizations disabled.
-
- 21 12月, 2016 1 次提交
-
-
由 Pavel Hrdina 提交于
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 11 4月, 2016 2 次提交
-
-
由 Pavel Hrdina 提交于
fdstream.c: In function 'virFDStreamWrite': fdstream.c:390:29: error: logical 'or' of equal expressions [-Werror=logical-op] if (errno == EAGAIN || errno == EWOULDBLOCK) { ^~ Fedora rawhide now uses gcc 6.0 and there is a bug with -Wlogical-op producing false warnings. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69602 Use GCC pragma push/pop and ignore -Wlogical-op for GCC that supports push/pop pragma and also has this bug. Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 27 5月, 2015 1 次提交
-
-
由 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>
-
- 17 1月, 2015 1 次提交
-
-
由 Daniel P. Berrange 提交于
Many GCC versions don't understand -Wno-suggest-attribute=format so the pragma must only be used when supported
-
- 12 6月, 2014 3 次提交
-
-
由 Ján Tomko 提交于
Try -fstack-protector-strong first on Linux. If that fails, fall back to -fstack-protector-all.
-
由 Ján Tomko 提交于
This option only makes sense for -fstack-protector. With -fstack-protector-all or -fstack-protector-strong, functions are protected regardless of buffer size. https://bugzilla.redhat.com/show_bug.cgi?id=1105456
-
由 Ján Tomko 提交于
These warnings have already been added to $dontwarn.
-
- 01 1月, 2014 1 次提交
-
-
由 Richard W.M. Jones 提交于
I'm using gcc-4.8.2-7.fc21.aarch64 which does not appear to support this option.
-
- 26 11月, 2013 1 次提交
-
-
由 Daniel P. Berrange 提交于
The python binding now lives in http://libvirt.org/git/?p=libvirt-python.git that repo also provides an RPM which is upgrade compatible with the old libvirt-python sub-RPM. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 24 9月, 2013 1 次提交
-
-
由 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>
-
- 17 8月, 2013 1 次提交
-
-
由 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>
-
- 07 8月, 2013 1 次提交
-
-
由 Eric Blake 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=994589 complained that even when using a cross-compiler not named 'gcc', the configure output confusingly referred to gcc. * m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS): Use a more generic statement in configure output. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 04 7月, 2013 2 次提交
-
-
由 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>
- 16 5月, 2013 1 次提交
-
-
由 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.
-
- 14 5月, 2013 3 次提交
-
-
由 Daniel P. Berrange 提交于
Automake already passes all CFLAGS to the linker too, so it is not necessary to set WARN_LDFLAGS in addition to the WARN_CFLAGS variable. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Clang will happily claim to support any warning flags unless the -Werror and -Wunknown-warning-option flags are set. Thus we need to make sure these are set when testing for clags. We must also set the clang specific warning flags -Wno-unused-command-line-argument to avoid a warning from the ssp-buffer-size flag when linking .o files. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The virt-compile-warnings.m4 file would do an explicit check for whether the compile could use the 'diagnostic' pragma push/pop feature. The src/internal.h file would then only enable it for GCC >= 4.6 This breaks with clang which supports the pragma but does not claim GCC 4.6 compat. Export a variable from the m4 check to the header file so they are consistent. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 08 4月, 2013 1 次提交
-
-
由 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>
-
- 20 12月, 2012 1 次提交
-
-
由 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.
-
- 24 10月, 2012 1 次提交
-
-
由 Eric Blake 提交于
Based on this coreutils bug report, since coreutils copied what libvirt had done: https://lists.gnu.org/archive/html/bug-coreutils/2012-10/msg00121.html * m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS): Allow for user to pre-define _FORTIFY_SOURCE.
-
- 02 10月, 2012 1 次提交
-
-
由 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.
-
- 08 9月, 2012 1 次提交
-
-
由 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.
-
- 06 9月, 2012 1 次提交
-
-
由 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.
-
- 16 8月, 2012 1 次提交
-
-
由 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.
-
- 03 8月, 2012 1 次提交
-
-
由 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>
-
- 08 6月, 2012 1 次提交
-
-
由 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.
-
- 05 6月, 2012 1 次提交
-
-
由 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.
-
- 28 3月, 2012 1 次提交
-
-
由 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
-
- 20 1月, 2012 1 次提交
-
-
由 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.
-
- 06 12月, 2011 1 次提交
-
-
由 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.
-
- 03 12月, 2011 1 次提交
-
-
由 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.
-
- 02 12月, 2011 1 次提交
-
-
由 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.
-
- 01 5月, 2011 1 次提交
-
-
由 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.
-
- 08 4月, 2011 1 次提交
-
-
由 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.
-