* [PATCH] Un-static gitmkstemps
@ 2011-09-15 12:21 Brian Gernhardt
2011-09-15 16:05 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Brian Gernhardt @ 2011-09-15 12:21 UTC (permalink / raw)
To: Git List; +Cc: Junio C Hamano
It may not be used in most builds, but it's used via a #ifdef in
git-compat-util.h Also, making it static makes a -Wall compile fail
since it's not used in the file without NO_MKSTEMPS.
Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
---
Either this, or it should be removed from git-compat-util and wrapped in
an #ifdef. (The only current user is git_mkstemps), but since it's
referenced in a header file, I figured it shouldn't be static.
wrapper.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/wrapper.c b/wrapper.c
index 390a7ae..1c41488 100644
--- a/wrapper.c
+++ b/wrapper.c
@@ -310,7 +310,7 @@ int git_mkstemp_mode(char *pattern, int mode)
return git_mkstemps_mode(pattern, 0, mode);
}
-static int gitmkstemps(char *pattern, int suffix_len)
+int gitmkstemps(char *pattern, int suffix_len)
{
return git_mkstemps_mode(pattern, suffix_len, 0600);
}
--
1.7.7.rc0.309.g13ed2.dirty
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Un-static gitmkstemps
2011-09-15 12:21 [PATCH] Un-static gitmkstemps Brian Gernhardt
@ 2011-09-15 16:05 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2011-09-15 16:05 UTC (permalink / raw)
To: Brian Gernhardt; +Cc: Git List
Brian Gernhardt <brian@gernhardtsoftware.com> writes:
> It may not be used in most builds, but it's used via a #ifdef in
> git-compat-util.h ...
Hmm, do you mean "#define", not "#ifdef", specifically, this:
maint:git-compat-util.h:#define mkstemps gitmkstemps
> ... Also, making it static makes a -Wall compile fail
> since it's not used in the file without NO_MKSTEMPS.
Your alternative of not defining on builds without NO_MKSTEMPS is better,
and probably even better yet, it would make sense to move the definition
of git_mkstemps() out of wrapper.c and have it somewhere in compat/, just
like the way in which compat/qsort.c defines git_qsort() that is used as a
replacement for qsort() via #define on systems that lack it.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-09-15 16:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-15 12:21 [PATCH] Un-static gitmkstemps Brian Gernhardt
2011-09-15 16:05 ` Junio C Hamano
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).