This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] config: Fix check for argp_parse to pass &argv


Right now it's passing a char* when it expects a char** instead.

This usually produces a warning that may go unnoticed, but if CFLAGS
contains -Werror, that breaks the ./configure run with the following
error:

  $ ./configure CFLAGS=-Werror
  ...
  configure: WARNING: "libc does not have argp"
  checking for argp_parse in -largp... no
  configure: error: "no libargp found"

Tested: Checked that after this fix, running ./configure CFLAGS=-Werror
works as expected and argp_parse is correctly detected.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 86a69c66fb20..72cb22e82d8a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -340,7 +340,7 @@ dnl Check if we have argp available from our libc
 AC_LINK_IFELSE(
 	[AC_LANG_PROGRAM(
 		[#include <argp.h>],
-		[int argc=1; char *argv[]={"test"}; argp_parse(0,argc,argv,0,0,0); return 0;]
+		[int argc=1; char *argv[]={"test"}; argp_parse(0,argc,&argv,0,0,0); return 0;]
 		)],
 	[libc_has_argp="true"],
 	[libc_has_argp="false"]
-- 
2.8.0.rc3.226.g39d4020

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]