{"thread":{"id":"28399","subject":"[PATCH] Un-static gitmkstemps","startedAt":"2011-09-15T12:21:00Z","lastAt":"2011-09-15T16:05:33Z","messageCount":2,"participants":["Brian Gernhardt","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"175575","messageId":"1316089260-76049-1-git-send-email-brian@gernhardtsoftware.com","threadId":"28399","inReplyTo":null,"subject":"[PATCH] Un-static gitmkstemps","fromName":"Brian Gernhardt","fromEmail":"brian@gernhardtsoftware.com","sentAt":"2011-09-15T12:21:00Z","receivedAt":"2011-09-15T12:21:00Z","isPatch":true,"sender":{"key":"brian@gernhardtsoftware.com","avatar":"https://avatars.githubusercontent.com/u/133455?v=4"},"body":"It may not be used in most builds, but it's used via a #ifdef in\ngit-compat-util.h  Also, making it static makes a -Wall compile fail\nsince it's not used in the file without NO_MKSTEMPS.\n\nSigned-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>\n---\n\n Either this, or it should be removed from git-compat-util and wrapped in\n an #ifdef.  (The only current user is git_mkstemps), but since it's\n referenced in a header file, I figured it shouldn't be static.\n\n wrapper.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/wrapper.c b/wrapper.c\nindex 390a7ae..1c41488 100644\n--- a/wrapper.c\n+++ b/wrapper.c\n@@ -310,7 +310,7 @@ int git_mkstemp_mode(char *pattern, int mode)\n \treturn git_mkstemps_mode(pattern, 0, mode);\n }\n \n-static int gitmkstemps(char *pattern, int suffix_len)\n+int gitmkstemps(char *pattern, int suffix_len)\n {\n \treturn git_mkstemps_mode(pattern, suffix_len, 0600);\n }\n-- \n1.7.7.rc0.309.g13ed2.dirty\n"},{"id":"175589","messageId":"7vvcstpz8y.fsf@alter.siamese.dyndns.org","threadId":"28399","inReplyTo":"1316089260-76049-1-git-send-email-brian@gernhardtsoftware.com","subject":"Re: [PATCH] Un-static gitmkstemps","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-09-15T16:05:33Z","receivedAt":"2011-09-15T16:05:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brian Gernhardt <brian@gernhardtsoftware.com> writes:\n\n> It may not be used in most builds, but it's used via a #ifdef in\n> git-compat-util.h  ...\n\nHmm, do you mean \"#define\", not \"#ifdef\", specifically, this:\n\n    maint:git-compat-util.h:#define mkstemps gitmkstemps\n\n> ... Also, making it static makes a -Wall compile fail\n> since it's not used in the file without NO_MKSTEMPS.\n\nYour alternative of not defining on builds without NO_MKSTEMPS is better,\nand probably even better yet, it would make sense to move the definition\nof git_mkstemps() out of wrapper.c and have it somewhere in compat/, just\nlike the way in which compat/qsort.c defines git_qsort() that is used as a\nreplacement for qsort() via #define on systems that lack it.\n"}]}