[libvirt] [PATCH] daemon: Fix compilation error of dispatch.c

[error message] CC libvirtd-dispatch.o dispatch.c: In function 'remoteDispatchFormatError': dispatch.c:83: error: 'va_list' undeclared (first use in this function) dispatch.c:83: error: (Each undeclared identifier is reported only once dispatch.c:83: error: for each function it appears in.) dispatch.c:83: error: expected ';' before 'args' cc1: warnings being treated as errors dispatch.c:87: error: implicit declaration of function 'va_start' [-Wimplicit-function-declaration] dispatch.c:87: error: nested extern declaration of 'va_start' [-Wnested-externs] dispatch.c:87: error: 'args' undeclared (first use in this function) dispatch.c:88: error: implicit declaration of function 'vsnprintf' [-Wimplicit-function-declaration] dispatch.c:89: error: implicit declaration of function 'va_end' [-Wimplicit-function-declaration] dispatch.c:89: error: nested extern declaration of 'va_end' [-Wnested-externs] * daemon/dispatch.c: include stdio.h and stdarg.h --- daemon/dispatch.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/daemon/dispatch.c b/daemon/dispatch.c index 8f55eaa..966db71 100644 --- a/daemon/dispatch.c +++ b/daemon/dispatch.c @@ -23,6 +23,9 @@ #include <config.h> +#include <stdio.h> +#include <stdarg.h> + #include "dispatch.h" #include "remote.h" -- 1.6.6.1

On Sun, Jul 04, 2010 at 07:02:32AM +0900, Ryota Ozaki wrote:
[error message] CC libvirtd-dispatch.o dispatch.c: In function 'remoteDispatchFormatError': dispatch.c:83: error: 'va_list' undeclared (first use in this function) dispatch.c:83: error: (Each undeclared identifier is reported only once dispatch.c:83: error: for each function it appears in.) dispatch.c:83: error: expected ';' before 'args' cc1: warnings being treated as errors dispatch.c:87: error: implicit declaration of function 'va_start' [-Wimplicit-function-declaration] dispatch.c:87: error: nested extern declaration of 'va_start' [-Wnested-externs] dispatch.c:87: error: 'args' undeclared (first use in this function) dispatch.c:88: error: implicit declaration of function 'vsnprintf' [-Wimplicit-function-declaration] dispatch.c:89: error: implicit declaration of function 'va_end' [-Wimplicit-function-declaration] dispatch.c:89: error: nested extern declaration of 'va_end' [-Wnested-externs]
What build platform do you see these errors on ? Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Mon, Jul 5, 2010 at 6:52 PM, Daniel P. Berrange <berrange@redhat.com> wrote:
On Sun, Jul 04, 2010 at 07:02:32AM +0900, Ryota Ozaki wrote:
[error message] CC libvirtd-dispatch.o dispatch.c: In function 'remoteDispatchFormatError': dispatch.c:83: error: 'va_list' undeclared (first use in this function) dispatch.c:83: error: (Each undeclared identifier is reported only once dispatch.c:83: error: for each function it appears in.) dispatch.c:83: error: expected ';' before 'args' cc1: warnings being treated as errors dispatch.c:87: error: implicit declaration of function 'va_start' [-Wimplicit-function-declaration] dispatch.c:87: error: nested extern declaration of 'va_start' [-Wnested-externs] dispatch.c:87: error: 'args' undeclared (first use in this function) dispatch.c:88: error: implicit declaration of function 'vsnprintf' [-Wimplicit-function-declaration] dispatch.c:89: error: implicit declaration of function 'va_end' [-Wimplicit-function-declaration] dispatch.c:89: error: nested extern declaration of 'va_end' [-Wnested-externs]
What build platform do you see these errors on ?
Fedora 12. I've confirmed with a clean slate, but the errors still happen. What I've done is: ./autogen.sh --enable-compile-warnings=error --enable-debug nice make -sj2 The errors still happen when --enable-debug dropped. Thanks. ozaki-r
Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Mon, Jul 05, 2010 at 07:40:50PM +0900, Ryota Ozaki wrote:
On Mon, Jul 5, 2010 at 6:52 PM, Daniel P. Berrange <berrange@redhat.com> wrote:
On Sun, Jul 04, 2010 at 07:02:32AM +0900, Ryota Ozaki wrote:
[error message] CC libvirtd-dispatch.o dispatch.c: In function 'remoteDispatchFormatError': dispatch.c:83: error: 'va_list' undeclared (first use in this function) dispatch.c:83: error: (Each undeclared identifier is reported only once dispatch.c:83: error: for each function it appears in.) dispatch.c:83: error: expected ';' before 'args' cc1: warnings being treated as errors dispatch.c:87: error: implicit declaration of function 'va_start' [-Wimplicit-function-declaration] dispatch.c:87: error: nested extern declaration of 'va_start' [-Wnested-externs] dispatch.c:87: error: 'args' undeclared (first use in this function) dispatch.c:88: error: implicit declaration of function 'vsnprintf' [-Wimplicit-function-declaration] dispatch.c:89: error: implicit declaration of function 'va_end' [-Wimplicit-function-declaration] dispatch.c:89: error: nested extern declaration of 'va_end' [-Wnested-externs]
What build platform do you see these errors on ?
Fedora 12.
I've confirmed with a clean slate, but the errors still happen. What I've done is: ./autogen.sh --enable-compile-warnings=error --enable-debug nice make -sj2
The errors still happen when --enable-debug dropped.
Weird, I'm F12 too, git pulled and followed exactly the same steps and no problem here: Making all in daemon GEN libvirtd.lxc.logrotate GEN libvirtd.uml.logrotate GEN libvirtd.init GEN libvirt-guests.init CC libvirtd-event.o CC libvirtd-libvirtd.o CC libvirtd-remote.o CC libvirtd-dispatch.o CC libvirtd-stream.o paphio:~/libvirt -> uname -a Linux paphio.veillard.com 2.6.32.14-127.fc12.x86_64 #1 SMP Fri May 28 04:30:39 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux it's an F12 fully updated. Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Mon, Jul 5, 2010 at 9:46 PM, Daniel Veillard <veillard@redhat.com> wrote:
On Mon, Jul 05, 2010 at 07:40:50PM +0900, Ryota Ozaki wrote:
On Mon, Jul 5, 2010 at 6:52 PM, Daniel P. Berrange <berrange@redhat.com> wrote:
On Sun, Jul 04, 2010 at 07:02:32AM +0900, Ryota Ozaki wrote:
[error message] CC libvirtd-dispatch.o dispatch.c: In function 'remoteDispatchFormatError': dispatch.c:83: error: 'va_list' undeclared (first use in this function) dispatch.c:83: error: (Each undeclared identifier is reported only once dispatch.c:83: error: for each function it appears in.) dispatch.c:83: error: expected ';' before 'args' cc1: warnings being treated as errors dispatch.c:87: error: implicit declaration of function 'va_start' [-Wimplicit-function-declaration] dispatch.c:87: error: nested extern declaration of 'va_start' [-Wnested-externs] dispatch.c:87: error: 'args' undeclared (first use in this function) dispatch.c:88: error: implicit declaration of function 'vsnprintf' [-Wimplicit-function-declaration] dispatch.c:89: error: implicit declaration of function 'va_end' [-Wimplicit-function-declaration] dispatch.c:89: error: nested extern declaration of 'va_end' [-Wnested-externs]
What build platform do you see these errors on ?
Fedora 12.
I've confirmed with a clean slate, but the errors still happen. What I've done is: ./autogen.sh --enable-compile-warnings=error --enable-debug nice make -sj2
The errors still happen when --enable-debug dropped.
Weird, I'm F12 too, git pulled and followed exactly the same steps and no problem here:
Making all in daemon GEN libvirtd.lxc.logrotate GEN libvirtd.uml.logrotate GEN libvirtd.init GEN libvirt-guests.init CC libvirtd-event.o CC libvirtd-libvirtd.o CC libvirtd-remote.o CC libvirtd-dispatch.o CC libvirtd-stream.o
paphio:~/libvirt -> uname -a Linux paphio.veillard.com 2.6.32.14-127.fc12.x86_64 #1 SMP Fri May 28 04:30:39 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
it's an F12 fully updated.
Oh, my box holds many pending packages to be updated. I'm now installing them all. I'll report the result of testing on the environment laster. Thanks. ozaki-r
Daniel
-- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Mon, Jul 5, 2010 at 10:11 PM, Ryota Ozaki <ozaki.ryota@gmail.com> wrote:
On Mon, Jul 5, 2010 at 9:46 PM, Daniel Veillard <veillard@redhat.com> wrote:
On Mon, Jul 05, 2010 at 07:40:50PM +0900, Ryota Ozaki wrote:
On Mon, Jul 5, 2010 at 6:52 PM, Daniel P. Berrange <berrange@redhat.com> wrote:
On Sun, Jul 04, 2010 at 07:02:32AM +0900, Ryota Ozaki wrote:
[error message] CC libvirtd-dispatch.o dispatch.c: In function 'remoteDispatchFormatError': dispatch.c:83: error: 'va_list' undeclared (first use in this function) dispatch.c:83: error: (Each undeclared identifier is reported only once dispatch.c:83: error: for each function it appears in.) dispatch.c:83: error: expected ';' before 'args' cc1: warnings being treated as errors dispatch.c:87: error: implicit declaration of function 'va_start' [-Wimplicit-function-declaration] dispatch.c:87: error: nested extern declaration of 'va_start' [-Wnested-externs] dispatch.c:87: error: 'args' undeclared (first use in this function) dispatch.c:88: error: implicit declaration of function 'vsnprintf' [-Wimplicit-function-declaration] dispatch.c:89: error: implicit declaration of function 'va_end' [-Wimplicit-function-declaration] dispatch.c:89: error: nested extern declaration of 'va_end' [-Wnested-externs]
What build platform do you see these errors on ?
Fedora 12.
I've confirmed with a clean slate, but the errors still happen. What I've done is: ./autogen.sh --enable-compile-warnings=error --enable-debug nice make -sj2
The errors still happen when --enable-debug dropped.
Weird, I'm F12 too, git pulled and followed exactly the same steps and no problem here:
Making all in daemon GEN libvirtd.lxc.logrotate GEN libvirtd.uml.logrotate GEN libvirtd.init GEN libvirt-guests.init CC libvirtd-event.o CC libvirtd-libvirtd.o CC libvirtd-remote.o CC libvirtd-dispatch.o CC libvirtd-stream.o
paphio:~/libvirt -> uname -a Linux paphio.veillard.com 2.6.32.14-127.fc12.x86_64 #1 SMP Fri May 28 04:30:39 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
it's an F12 fully updated.
Oh, my box holds many pending packages to be updated.
I'm now installing them all. I'll report the result of testing on the environment laster.
Unfortunately the errors still happen after updating. Even worse, they happen on an old commit that I was able to compile successfully so far. So I guess my box went wrong at some point. Please ignore the patch because it seems a problem of my box... Thanks. ozaki-r
Thanks. ozaki-r
Daniel
-- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

Unfortunately the errors still happen after updating. Even worse, they happen on an old commit that I was able to compile successfully so far. So I guess my box went wrong at some point.
FYI. My box has repaired by removing /usr/local/include/rpc/ which is installed by portablexdr to build MinGW cross-compile environment. I don´t know why/how the headers affect to libvirt compilation. ozaki-r
Please ignore the patch because it seems a problem of my box...
Thanks. ozaki-r

On Thu, Jul 08, 2010 at 01:55:23AM +0900, Ryota Ozaki wrote:
Unfortunately the errors still happen after updating. Even worse, they happen on an old commit that I was able to compile successfully so far. So I guess my box went wrong at some point.
FYI. My box has repaired by removing /usr/local/include/rpc/ which is installed by portablexdr to build MinGW cross-compile environment. I don´t know why/how the headers affect to libvirt compilation.
Huh, that's weird, maybe the compiler takes /usr/local/include/blah... before /usr/include/blah... Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Thu, Jul 8, 2010 at 2:40 AM, Daniel Veillard <veillard@redhat.com> wrote:
On Thu, Jul 08, 2010 at 01:55:23AM +0900, Ryota Ozaki wrote:
Unfortunately the errors still happen after updating. Even worse, they happen on an old commit that I was able to compile successfully so far. So I guess my box went wrong at some point.
FYI. My box has repaired by removing /usr/local/include/rpc/ which is installed by portablexdr to build MinGW cross-compile environment. I don´t know why/how the headers affect to libvirt compilation.
Huh, that's weird, maybe the compiler takes /usr/local/include/blah... before /usr/include/blah...
My box's gcc seems trying to search /usr/local/include firstly... I'm not sure this is expected behavior or not. gcc -v dispatch.c 2>&1 |grep include ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/4.4.4/include-fixed" ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../x86_64-redhat-linux/include" #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/lib/gcc/x86_64-redhat-linux/4.4.4/include /usr/include In file included from dispatch.h:28, In file included from dispatch.h:28, In file included from dispatch.c:26: In file included from remote.h:31, In file included from remote.h:35, In file included from dispatch.c:27: $ gcc -v Using built-in specs. Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix gcc version 4.4.4 20100630 (Red Hat 4.4.4-10) (GCC) $ which gcc /usr/bin/gcc $ rpm -qf /usr/bin/gcc gcc-4.4.4-10.fc12.x86_64 Thanks. ozaki-r
Daniel
-- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Thu, Jul 8, 2010 at 3:31 AM, Ryota Ozaki <ozaki.ryota@gmail.com> wrote:
On Thu, Jul 8, 2010 at 2:40 AM, Daniel Veillard <veillard@redhat.com> wrote:
On Thu, Jul 08, 2010 at 01:55:23AM +0900, Ryota Ozaki wrote:
Unfortunately the errors still happen after updating. Even worse, they happen on an old commit that I was able to compile successfully so far. So I guess my box went wrong at some point.
FYI. My box has repaired by removing /usr/local/include/rpc/ which is installed by portablexdr to build MinGW cross-compile environment. I don´t know why/how the headers affect to libvirt compilation.
Huh, that's weird, maybe the compiler takes /usr/local/include/blah... before /usr/include/blah...
My box's gcc seems trying to search /usr/local/include firstly... I'm not sure this is expected behavior or not.
Anyway, dispatch.c requires stdio.h but now it implicitly depends on that rpc/xdr.h includes stdio.h. [Inclusions] dispatch.c libvirtd.h rpc/xdr.h stdio.h I think including stdio.h explicitly in dispatch.c is not bad idea. How do you think, Daniel? ozaki-r
gcc -v dispatch.c 2>&1 |grep include ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/4.4.4/include-fixed" ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../x86_64-redhat-linux/include" #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/lib/gcc/x86_64-redhat-linux/4.4.4/include /usr/include In file included from dispatch.h:28, In file included from dispatch.h:28, In file included from dispatch.c:26: In file included from remote.h:31, In file included from remote.h:35, In file included from dispatch.c:27:
$ gcc -v Using built-in specs. Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix gcc version 4.4.4 20100630 (Red Hat 4.4.4-10) (GCC)
$ which gcc /usr/bin/gcc
$ rpm -qf /usr/bin/gcc gcc-4.4.4-10.fc12.x86_64
Thanks. ozaki-r
Daniel
-- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Thu, Jul 08, 2010 at 03:53:06AM +0900, Ryota Ozaki wrote:
On Thu, Jul 8, 2010 at 3:31 AM, Ryota Ozaki <ozaki.ryota@gmail.com> wrote:
On Thu, Jul 8, 2010 at 2:40 AM, Daniel Veillard <veillard@redhat.com> wrote:
On Thu, Jul 08, 2010 at 01:55:23AM +0900, Ryota Ozaki wrote:
Unfortunately the errors still happen after updating. Even worse, they happen on an old commit that I was able to compile successfully so far. So I guess my box went wrong at some point.
FYI. My box has repaired by removing /usr/local/include/rpc/ which is installed by portablexdr to build MinGW cross-compile environment. I don´t know why/how the headers affect to libvirt compilation.
Huh, that's weird, maybe the compiler takes /usr/local/include/blah... before /usr/include/blah...
My box's gcc seems trying to search /usr/local/include firstly... I'm not sure this is expected behavior or not.
Anyway, dispatch.c requires stdio.h but now it implicitly depends on that rpc/xdr.h includes stdio.h.
[Inclusions] dispatch.c libvirtd.h rpc/xdr.h stdio.h
I think including stdio.h explicitly in dispatch.c is not bad idea. How do you think, Daniel?
Yes, we shouldn't rely on rpc/xdr.h to include it Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Thu, Jul 8, 2010 at 6:26 PM, Daniel P. Berrange <berrange@redhat.com> wrote:
On Thu, Jul 08, 2010 at 03:53:06AM +0900, Ryota Ozaki wrote:
On Thu, Jul 8, 2010 at 3:31 AM, Ryota Ozaki <ozaki.ryota@gmail.com> wrote:
On Thu, Jul 8, 2010 at 2:40 AM, Daniel Veillard <veillard@redhat.com> wrote:
On Thu, Jul 08, 2010 at 01:55:23AM +0900, Ryota Ozaki wrote:
Unfortunately the errors still happen after updating. Even worse, they happen on an old commit that I was able to compile successfully so far. So I guess my box went wrong at some point.
FYI. My box has repaired by removing /usr/local/include/rpc/ which is installed by portablexdr to build MinGW cross-compile environment. I don´t know why/how the headers affect to libvirt compilation.
Huh, that's weird, maybe the compiler takes /usr/local/include/blah... before /usr/include/blah...
My box's gcc seems trying to search /usr/local/include firstly... I'm not sure this is expected behavior or not.
Anyway, dispatch.c requires stdio.h but now it implicitly depends on that rpc/xdr.h includes stdio.h.
[Inclusions] dispatch.c libvirtd.h rpc/xdr.h stdio.h
I think including stdio.h explicitly in dispatch.c is not bad idea. How do you think, Daniel?
Yes, we shouldn't rely on rpc/xdr.h to include it
OK, Thanks. I'll soon resend the patch with updating the comment. ozaki-r
Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Ryota Ozaki