From: Robin Rosenberg <robin.rosenberg.lists@dewire.com>
To: Alex Riesen <raa.lkml@gmail.com>
Cc: Guido Ostkamp <git@ostkamp.fastmail.fm>,
Junio C Hamano <gitster@pobox.com>,
git@vger.kernel.org
Subject: Re: [PATCH] Rewrite some function exit paths to avoid "unreachable code" traps
Date: Sat, 17 Nov 2007 11:39:32 +0100 [thread overview]
Message-ID: <200711171139.32631.robin.rosenberg.lists@dewire.com> (raw)
In-Reply-To: <20071117094617.GD4086@steel.home>
lördag 17 november 2007 skrev Alex Riesen:
> Noticed by Guido Ostkamp for Sun's Workshop cc.
>
> Originally-by: Guido Ostkamp <git@ostkamp.fastmail.fm>
> Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
> ---
> Guido Ostkamp, Fri, Nov 16, 2007 23:52:01 +0100:
> >
> > What about the xdiff/xdiffi.c problem that should also be solved?
> >
>
Please... This just looks bad. I'm sure we'll have fixup patches on the list
to fix those gotos.
Do we support any such stupid compiler that requires a dummy goto?
If so we could just add a macro to compat-util.h
#if stupid_compiler
#define DUMMY_RETURN(x) return x;
#else
#define DUMMY_RETURN(x)
#endif
and then use it like this:
diff --git a/builtin-apply.c b/builtin-apply.c
index 8edcc08..91f8752 100644
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@ -683,7 +683,6 @@ static char *git_header_name(char *line, int llen)
}
}
}
- return NULL;
+ DUMMY_RETURN(NULL)
}
My vote is for Guidos patch and fallback to the suggestion above if we support
really stupid compilers.
-- robin
next prev parent reply other threads:[~2007-11-17 10:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-15 22:19 [PATCH] Fix Solaris compiler warnings Guido Ostkamp
2007-11-15 23:00 ` Alex Riesen
2007-11-15 23:16 ` Junio C Hamano
2007-11-16 7:48 ` Alex Riesen
2007-11-16 9:14 ` Junio C Hamano
2007-11-16 22:52 ` Guido Ostkamp
2007-11-17 9:46 ` [PATCH] Rewrite some function exit paths to avoid "unreachable code" traps Alex Riesen
2007-11-17 10:39 ` Robin Rosenberg [this message]
2007-11-17 12:23 ` Alex Riesen
2007-11-17 14:31 ` Robin Rosenberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200711171139.32631.robin.rosenberg.lists@dewire.com \
--to=robin.rosenberg.lists@dewire.com \
--cc=git@ostkamp.fastmail.fm \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=raa.lkml@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).