- 09 10月, 2019 1 次提交
-
-
由 Daniel P. Berrangé 提交于
Clang's gnu99 mode is not quite the same as GCC's. It will complain about redefined typedefs being a C11 feature, while GCC does not complain and allows them in gnu99 mode. Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 08 10月, 2019 1 次提交
-
-
由 Daniel P. Berrangé 提交于
When adding the -std=gnu99 flag, we set $wantwarn instead of appending to it. This meant all the compiler warnings were accidentally discarded. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 07 10月, 2019 1 次提交
-
-
由 Daniel P. Berrangé 提交于
We previously got -std=gnu99 secretly enabled as a side-effect of requesting the 'stdarg' gnulib module. We rely on some extensions from c99/gnu99 and while RHEL-7 supports this, it still defaults to gnu89. RHEL-7 also supports some newer standards but declares them experimental/incomplete, so sticking with gnu99 is best bet for now & matches historical usage. Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 07 8月, 2019 1 次提交
-
-
由 Daniel P. Berrangé 提交于
The previous bump to 4.4 was done in: commit 24241c23 Author: Daniel P. Berrange <berrange@redhat.com> Date: Wed Jul 5 10:35:32 2017 +0100 Require use of GCC 4.4 or CLang compilers with 4.4 picked due to RHEL-6. Since we dropped RHEL-6, the next oldest distro is RHEL-7 (4.8.5), and thus we pick 4.8 as the new min. Reviewed-by: NAndrea Bolognani <abologna@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 22 2月, 2018 1 次提交
-
-
由 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>
-
- 16 2月, 2018 1 次提交
-
-
由 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>
-
- 18 1月, 2018 1 次提交
-
-
由 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.
-
- 06 9月, 2017 1 次提交
-
-
由 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>
-
- 28 8月, 2017 1 次提交
-
-
由 Eric Blake 提交于
3 out of 4 uses of gl_WARN_ADD() were incorrectly adding "" around the argument, which in turn resulted in the argument being used unquoted (configure had gl_positive=""-fstack-protector-all"", rather than the intended gl_positive="-fstack-protector-all"). Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
-
- 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>
-