[libvirt] [PATCH] build: avoid compiler warning on 32-bit platform

2014-05-30 Thread Eric Blake
On a 32-bit platform: virstringtest.c: In function 'mymain': virstringtest.c:673: warning: this decimal constant is unsigned only in ISO C90 I already had a comment in the file about the 64-bit counterpart; the easiest fix was to make both sites use the standardized macro that is guaranteed to wo

Re: [libvirt] [PATCH] build: avoid compiler warning on shadowed name

2014-04-09 Thread Ján Tomko
On 04/09/2014 08:50 AM, Jean-Baptiste Rouault wrote: > Introduced in commit d1e55de3. > virstoragetest.c: In function ‘testStorageChain’: > virstoragetest.c:249:10: warning: declaration of ‘abs’ shadows a global > declaration [-Wshadow] > --- > tests/virstoragetest.c | 4 ++-- > 1 file changed, 2

[libvirt] [PATCH] build: avoid compiler warning on shadowed name

2014-04-08 Thread Jean-Baptiste Rouault
Introduced in commit d1e55de3. virstoragetest.c: In function ‘testStorageChain’: virstoragetest.c:249:10: warning: declaration of ‘abs’ shadows a global declaration [-Wshadow] --- tests/virstoragetest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/virstoragetest.c

[libvirt] [PATCH] build: avoid compiler warning on shadowed name

2013-07-16 Thread Eric Blake
Introduced in commit 24b08219; compilation on RHEL 6.4 complained: qemu/qemu_hotplug.c: In function 'qemuDomainAttachChrDevice': qemu/qemu_hotplug.c:1257: error: declaration of 'remove' shadows a global declaration [-Wshadow] /usr/include/stdio.h:177: error: shadowed declaration is here [-Wshadow]

[libvirt] [PATCH] build: avoid compiler warning

2013-01-08 Thread Eric Blake
gcc 4.1.2 on RHEL 5 warned: conf/network_conf.c:3136: warning: 'foundIdx' may be used uninitialized in this function The warning is spurious, but initializing the variable doesn't hurt. * src/conf/network_conf.c (virNetworkDefUpdateDNSHost): Silence unused variable warning. --- Pushing under th

[libvirt] [PATCH] build: avoid compiler warning on non-Linux

2011-06-15 Thread Eric Blake
Detected by autobuild.sh when cross-building for mingw. * src/nodeinfo.c (nodeGetCPUStats, nodeGetMemoryStats): Mark parameters as potentially unused. --- Pushing under the build-breaker rule. src/nodeinfo.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src

[libvirt] [PATCH] build: avoid compiler warning on cygwin

2011-04-06 Thread Eric Blake
In file included from util/threads.c:31: util/threads-pthread.c: In function 'virThreadSelfID': util/threads-pthread.c:214: warning: cast from function call of type 'pthread_t' to non-matching type 'int' [-Wbad-function-cast] * src/util/threads-pthread.c (virThreadSelfID) [!SYS_gettid]: Add inter

[libvirt] [PATCH] build: avoid compiler warning in xen code

2010-11-01 Thread Eric Blake
* src/xen/xend_internal.c (xenDaemonFormatSxpr): Hoist verify outside of function to avoid a -Wnested-externs warning. * src/xen/xm_internal.c (xenXMDomainConfigFormat): Likewise. Reported by Daniel P. Berrange. --- > Making it use verify_true() instead, works though Not really, as that then tri

Re: [libvirt] [PATCH] build: avoid compiler warning

2010-05-03 Thread Eric Blake
On 05/03/2010 05:05 PM, Matthias Bolte wrote: > 2010/5/4 Eric Blake : >> Necessary on cygwin, where uid_t and gid_t are 4-byte long rather >> than int, causing gcc -Wformat warnings. >> >> * src/util/util.c (virFileOperationNoFork, virDirCreateNoFork) >> (virFileOperation, virDirCreate, virGetUserE

Re: [libvirt] [PATCH] build: avoid compiler warning

2010-05-03 Thread Matthias Bolte
2010/5/4 Eric Blake : > Necessary on cygwin, where uid_t and gid_t are 4-byte long rather > than int, causing gcc -Wformat warnings. > > * src/util/util.c (virFileOperationNoFork, virDirCreateNoFork) > (virFileOperation, virDirCreate, virGetUserEnt): Cast uid_t and > gid_t before passing to printf.

[libvirt] [PATCH] build: avoid compiler warning

2010-05-03 Thread Eric Blake
Necessary on cygwin, where uid_t and gid_t are 4-byte long rather than int, causing gcc -Wformat warnings. * src/util/util.c (virFileOperationNoFork, virDirCreateNoFork) (virFileOperation, virDirCreate, virGetUserEnt): Cast uid_t and gid_t before passing to printf. * .gitignore: Ignore Windows exe

Re: [libvirt] [PATCH] build: avoid compiler warning

2010-05-03 Thread Eric Blake
On 05/03/2010 03:41 PM, Matthias Bolte wrote: >> @@ -1277,7 +1280,7 @@ static int virFileOperationNoFork(const char *path, >> int openflags, mode_t mode, >> && (fchown(fd, uid, gid) < 0)) { >> ret = errno; >> virReportSystemError(errno, _("cannot chown '%s' to (%u, %u)"), >

Re: [libvirt] [PATCH] build: avoid compiler warning

2010-05-03 Thread Matthias Bolte
2010/5/3 Eric Blake : > Necessary on cygwin, where uid_t and gid_t are 4-byte long rather > than int, causing gcc -Wformat warnings. > > * src/util/util.c (virFileOperationNoFork, virDirCreateNoFork) > (virFileOperation, virDirCreate, virGetUserEnt): Cast uid_t and > gid_t before passing to printf.

[libvirt] [PATCH] build: avoid compiler warning

2010-05-03 Thread Eric Blake
Necessary on cygwin, where uid_t and gid_t are 4-byte long rather than int, causing gcc -Wformat warnings. * src/util/util.c (virFileOperationNoFork, virDirCreateNoFork) (virFileOperation, virDirCreate, virGetUserEnt): Cast uid_t and gid_t before passing to printf. * .gitignore: Ignore cygwin exec

[libvirt] [PATCH] build: avoid compiler warning

2010-04-20 Thread Eric Blake
According to GCC, ATTRIBUTE_UNUSED means that an attribute _might_ be unused, not _must_ be unused. Therefore, it is easier to blindly mark a variable, than to try and do preprocessor limiting of when we know it is unused. * src/remote/remote_driver.c (remoteAuthenticate): Mark attribute as poten