Thread (16 messages) flat view 16 messages, 2 authors, 2016-06-15

Re: [PATCH 07/12] Git.pm: Better error handling

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:31
Subsystem: the rest · Maintainer: Linus Torvalds

Petr Baudis [off-list ref] writes:
+int
+error_xs(const char *err, va_list params)
+{
You said in git-compat-util.h that set_error_routine takes a
function that returns void, so this gives unnecessary type
clash.

--------------------------------
In file included from /usr/lib/perl/5.8/CORE/perl.h:756,
                 from Git.xs:15:
/usr/lib/perl/5.8/CORE/embed.h:4193:1: warning: "die" redefined
Git.xs:11:1: warning: this is the location of the previous definition
Git.xs: In function 'boot_Git':
Git.xs:57: warning: passing argument 1 of 'set_error_routine' from incompatible pointer type
Git.xs:58: warning: passing argument 1 of 'set_die_routine' makes qualified function pointer from unqualified
--------------------------------

Other troubles I saw with the v4 series while compiling:

--------------------------------
usage.c:35: warning: initialization makes qualified function pointer from unqualified
usage.c:36: warning: initialization makes qualified function pointer from unqualified

I'd fix it with this
diff --git a/usage.c b/usage.c
index b781b00..52c2e96 100644
--- a/usage.c
+++ b/usage.c
@@ -12,19 +12,19 @@ static void report(const char *prefix, c
 	fputs("\n", stderr);
 }
 
-void usage_builtin(const char *err)
+static NORETURN void usage_builtin(const char *err)
 {
 	fprintf(stderr, "usage: %s\n", err);
 	exit(129);
 }
 
-void die_builtin(const char *err, va_list params)
+static NORETURN void die_builtin(const char *err, va_list params)
 {
 	report("fatal: ", err, params);
 	exit(128);
 }
 
-void error_builtin(const char *err, va_list params)
+static void error_builtin(const char *err, va_list params)
 {
 	report("error: ", err, params);
 }

--------------------------------
(cd perl && /usr/bin/perl Makefile.PL \
                PREFIX="/home/junio/git-test" \
                DEFINE="-O2 -Wall -Wdeclaration-after-statement
                -g -DSHA1_HEADER='<openssl/sha.h>'
                -DGIT_VERSION=\\\"1.4.1.rc1.gab0df\\\"" \
                LIBS="libgit.a xdiff/lib.a -lz  -lcrypto")
Unrecognized argument in LIBS ignored: 'libgit.a'
Unrecognized argument in LIBS ignored: 'xdiff/lib.a'

Do you need to pass LIBS, and if so maybe this is not a way
Makefile.PL expects it to be passed perhaps?

--------------------------------
Makefile out-of-date with respect to Makefile.PL
Cleaning current config before rebuilding Makefile...
make -f Makefile.old clean > /dev/null 2>&1
/usr/bin/perl Makefile.PL "PREFIX=/home/junio/git-test" "DEFINE=-O2 -Wall -Wdeclaration-after-statement -g -DSHA1_HEADER='<openssl/sha.h>'  -DGIT_VERSION=\"1.4.1.rc1.gab0df\"" "LIBS=libgit.a xdiff/lib.a -lz  -lcrypto"
Unrecognized argument in LIBS ignored: 'libgit.a'
Unrecognized argument in LIBS ignored: 'xdiff/lib.a'
Writing Makefile for Git
==> Your Makefile has been rebuilt. <==
==> Please rerun the make command.  <==
false
make[1]: *** [Makefile] Error 1
--------------------------------

The latter is what Perl's build mechanism does so it is not
strictly your fault, but it nevertheless is irritating that we
have to say make clean twice.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help