Re: [PATCH 07/12] Git.pm: Better error handling
- From
Petr Baudis <pasky@suse.cz>
- Date
- Jun 25, 2006, 01:13 UTC
- Message-ID
- <20060625011347.GY21864@pasky.or.cz>
- In-Reply-To
- <20060624131731.GU21864@pasky.or.cz>
Dear diary, on Sat, Jun 24, 2006 at 03:17:31PM CEST, I got a letter where Petr Baudis <pasky@suse.cz> said that...
Show 23 quoted lines
> Dear diary, on Sat, Jun 24, 2006 at 10:37:25AM CEST, I got a letter
> where Junio C Hamano <junkio@cox.net> said that...
> > Petr Baudis <pasky@suse.cz> 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
> > --------------------------------
>
> Oh, I forgot to fix it in the .xs. :-(--- [PATCH] Git.pm: Squash some annoying warnings in Git.xs
From: Petr Baudis <pasky@suse.cz>
Signed-off-by: Petr Baudis <pasky@suse.cz> ---
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.