Jim Meyering
2011-Apr-13 11:00 UTC
[Libguestfs] [PATCH libguestfs] add missing include directives
A few minor problems: (more coming) config.c:55:5: error: implicit declaration of function 'strlen' [-Werror=implicit-function-declaration] config.c:55:11: error: incompatible implicit declaration of built-in function 'strlen' [-Werror] ... keys.c:59:7: error: implicit declaration of function 'memcpy' [-Werror=implicit-function-declaration] keys.c:59:7: error: incompatible implicit declaration of built-in function 'memcpy' [-Werror] man.c:42:3: error: implicit declaration of function 'memset' [-Werror=implicit-function-declaration] man.c:42:3: error: incompatible implicit declaration of built-in function 'memset' [-Werror] Here's a patch:>From abf6a50d39aa9015d5df0336a0ac61155e0df973 Mon Sep 17 00:00:00 2001From: Jim Meyering <meyering at redhat.com> Date: Wed, 13 Apr 2011 12:57:54 +0200 Subject: [PATCH libguestfs] add missing include directives * fish/config.c: Include string.h, for use of strlen. * fish/keys.c: Likewise, but for use of memcpy. * fish/man.c: Likewise, but for use of memset. --- fish/config.c | 1 + fish/keys.c | 3 ++- fish/man.c | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/fish/config.c b/fish/config.c index c1d34fb..66d2810 100644 --- a/fish/config.c +++ b/fish/config.c @@ -20,6 +20,7 @@ #include <stdio.h> #include <stdlib.h> +#include <string.h> #ifdef HAVE_LIBCONFIG #include <libconfig.h> diff --git a/fish/keys.c b/fish/keys.c index deb627f..ec15c8f 100644 --- a/fish/keys.c +++ b/fish/keys.c @@ -1,5 +1,5 @@ /* libguestfs - guestfish and guestmount shared option parsing - * Copyright (C) 2010 Red Hat Inc. + * Copyright (C) 2010-2011 Red Hat Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,6 +22,7 @@ #include <stdlib.h> #include <unistd.h> #include <termios.h> +#include <string.h> #include "guestfs.h" diff --git a/fish/man.c b/fish/man.c index 1965b64..522a86c 100644 --- a/fish/man.c +++ b/fish/man.c @@ -1,5 +1,5 @@ /* guestfish - the filesystem interactive shell - * Copyright (C) 2010 Red Hat Inc. + * Copyright (C) 2010-2011 Red Hat Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,6 +21,7 @@ #include <stdio.h> #include <stdlib.h> #include <signal.h> +#include <string.h> #include <sys/wait.h> #include "fish.h" -- 1.7.5.rc1.228.g86d60b
Richard W.M. Jones
2011-Apr-13 11:07 UTC
[Libguestfs] [PATCH libguestfs] add missing include directives
Thanks, I've pushed both of these patches. I've no idea why I didn't see those warnings. I too am compiling everything with --enable-gcc-warnings ... Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw