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

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

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

Dear diary, on Sat, Jun 24, 2006 at 03:17:31PM CEST, I got a letter
where Petr Baudis [off-list ref] said that...
Dear diary, on Sat, Jun 24, 2006 at 10:37:25AM CEST, I got a letter
where Junio C Hamano [off-list ref] said that...
quoted
Petr Baudis [off-list ref] writes:
quoted
+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
--------------------------------
Oh, I forgot to fix it in the .xs. :-(
---
[PATCH] Git.pm: Squash some annoying warnings in Git.xs

From: Petr Baudis <redacted>

Signed-off-by: Petr Baudis <redacted>
---

 perl/Git.xs |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/perl/Git.xs b/perl/Git.xs
index e841e4a..d7a2b75 100644
--- a/perl/Git.xs
+++ b/perl/Git.xs
@@ -29,21 +29,18 @@ report_xs(const char *prefix, const char
 	return buf;
 }
 
-void
+void NORETURN
 die_xs(const char *err, va_list params)
 {
-	char *str;
-	str = report_xs("fatal: ", err, params);
+	char *str = report_xs("fatal: ", err, params);
 	croak(str);
 }
 
-int
+void
 error_xs(const char *err, va_list params)
 {
-	char *str;
-	str = report_xs("error: ", err, params);
+	char *str = report_xs("error: ", err, params);
 	warn(str);
-	return -1;
 }
 
 
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
A person is just about as big as the things that make them angry.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help