* [PATCH] config: Fix check for argp_parse to pass &argv
@ 2016-05-02 19:18 Filipe Brandenburger
0 siblings, 0 replies; 3+ messages in thread
From: Filipe Brandenburger @ 2016-05-02 19:18 UTC (permalink / raw)
To: elfutils-devel
[-- Attachment #1: Type: text/plain, Size: 1175 bytes --]
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] config: Fix check for argp_parse to pass &argv
@ 2016-05-02 20:26 Filipe Brandenburger
0 siblings, 0 replies; 3+ messages in thread
From: Filipe Brandenburger @ 2016-05-02 20:26 UTC (permalink / raw)
To: elfutils-devel
[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]
Hi Mark,
On Mon, May 2, 2016 at 12:51 PM, Mark Wielaard <mjw@redhat.com> wrote:
> Thanks. Looks correct. I added a ChangeLog entry and pushed this.
Thanks Mark!
> (One of these days we'll have to think of an alternative for ChangeLogs.)
It would be nice to generate those from `git log` somehow... I know
dejagnu actually requires that the git log message is ChangeLog
formatted but that looks awful from a git perspective :-)
> Note that in general passing -Werror should not be necessary because
> the build should add -Werror where necessary to catch any new warnings
> early. Some extra -Werror is always nice of course (although you might
> want to watch for where the build uses no_Werror = yes, currently only
> ldlex because it is a generated file).
Ok, so it turns out the other problem I'm running into is that
detection of supported compiler warnings is not done with -Werror, so
configure thinks they're supported while in fact they're not, and
later on when the build is done with -Werror (for most targets) they
start failing since the options are unsupported...
I have a follow up fix, will send you another patch shortly.
This time with ChangeLog :-)
Cheers!
Filipe
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] config: Fix check for argp_parse to pass &argv
@ 2016-05-02 19:51 Mark Wielaard
0 siblings, 0 replies; 3+ messages in thread
From: Mark Wielaard @ 2016-05-02 19:51 UTC (permalink / raw)
To: elfutils-devel
[-- Attachment #1: Type: text/plain, Size: 1109 bytes --]
On Mon, May 02, 2016 at 12:18:47PM -0700, Filipe Brandenburger wrote:
> 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.
Thanks. Looks correct. I added a ChangeLog entry and pushed this.
(One of these days we'll have to think of an alternative for ChangeLogs.)
Note that in general passing -Werror should not be necessary because
the build should add -Werror where necessary to catch any new warnings
early. Some extra -Werror is always nice of course (although you might
want to watch for where the build uses no_Werror = yes, currently only
ldlex because it is a generated file).
Cheers,
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-05-02 20:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-02 19:18 [PATCH] config: Fix check for argp_parse to pass &argv Filipe Brandenburger
2016-05-02 19:51 Mark Wielaard
2016-05-02 20:26 Filipe Brandenburger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).