[libvirt] [PATCH] build: fix compilation of virt-login-shell.c

virt-login-shell.c was failing to compile with CC virt_login_shell-virt-login-shell.o virt-login-shell.c: In function 'main': virt-login-shell.c:205:5: error: implicit declaration of function 'setlocale' [-Werror=implicit-function-declaration] virt-login-shell.c:205:5: error: nested extern declaration of 'setlocale' [-Werror=nested-externs] virt-login-shell.c:205:20: error: 'LC_ALL' undeclared (first use in this function) --- I'm a little surprised that others are not seeing this problem, so a bit nervious committing without an ACK. tools/virt-login-shell.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/virt-login-shell.c b/tools/virt-login-shell.c index ffbc713..b8f1a28 100644 --- a/tools/virt-login-shell.c +++ b/tools/virt-login-shell.c @@ -27,6 +27,7 @@ #include <errno.h> #include <stdlib.h> #include <fnmatch.h> +#include <locale.h> #include "internal.h" #include "virerror.h" -- 1.8.1.4

On 08/08/2013 02:04 PM, Jim Fehlig wrote:
virt-login-shell.c was failing to compile with
CC virt_login_shell-virt-login-shell.o virt-login-shell.c: In function 'main': virt-login-shell.c:205:5: error: implicit declaration of function 'setlocale' [-Werror=implicit-function-declaration] virt-login-shell.c:205:5: error: nested extern declaration of 'setlocale' [-Werror=nested-externs] virt-login-shell.c:205:20: error: 'LC_ALL' undeclared (first use in this function) ---
I'm a little surprised that others are not seeing this problem, so a bit nervious committing without an ACK.
ACK - go for it. It depends on which version of glibc you use as to whether you see the error (I reproduced it with glibc 2.17 of Fedora 19, but suspect that Dan Walsh developed the patch on an older platform). -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

Eric Blake wrote:
On 08/08/2013 02:04 PM, Jim Fehlig wrote:
virt-login-shell.c was failing to compile with
CC virt_login_shell-virt-login-shell.o virt-login-shell.c: In function 'main': virt-login-shell.c:205:5: error: implicit declaration of function 'setlocale' [-Werror=implicit-function-declaration] virt-login-shell.c:205:5: error: nested extern declaration of 'setlocale' [-Werror=nested-externs] virt-login-shell.c:205:20: error: 'LC_ALL' undeclared (first use in this function) ---
I'm a little surprised that others are not seeing this problem, so a bit nervious committing without an ACK.
ACK - go for it. It depends on which version of glibc you use as to whether you see the error (I reproduced it with glibc 2.17 of Fedora 19, but suspect that Dan Walsh developed the patch on an older platform).
Ah, I see. I noticed the issue with glibc 2.17 as well. Thanks, pushed now. Regards, Jim

On Thu, Aug 08, 2013 at 02:28:53PM -0600, Eric Blake wrote:
On 08/08/2013 02:04 PM, Jim Fehlig wrote:
virt-login-shell.c was failing to compile with
CC virt_login_shell-virt-login-shell.o virt-login-shell.c: In function 'main': virt-login-shell.c:205:5: error: implicit declaration of function 'setlocale' [-Werror=implicit-function-declaration] virt-login-shell.c:205:5: error: nested extern declaration of 'setlocale' [-Werror=nested-externs] virt-login-shell.c:205:20: error: 'LC_ALL' undeclared (first use in this function) ---
I'm a little surprised that others are not seeing this problem, so a bit nervious committing without an ACK.
ACK - go for it. It depends on which version of glibc you use as to whether you see the error (I reproduced it with glibc 2.17 of Fedora 19, but suspect that Dan Walsh developed the patch on an older platform).
That's strange, I compile tested this, and did the full RPM build on my F19 host with that glibc version. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (3)
-
Daniel P. Berrange
-
Eric Blake
-
Jim Fehlig