{"thread":{"id":"20638","subject":"[PATCH 01/11] Fix build failure at VC because function declare use old style at regex.c","startedAt":"2009-08-17T16:01:02Z","lastAt":"2009-08-19T15:21:29Z","messageCount":26,"participants":["Frank Li","Johannes Schindelin","Reece Dunn","Junio C Hamano","tom fogal","Marius Storm-Olsen","Matthieu Moy","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":11},"messages":[{"id":"120907","messageId":"1250524872-5148-1-git-send-email-lznuaa@gmail.com","threadId":"20638","inReplyTo":null,"subject":"[PATCH 01/11] Fix build failure at VC because function declare use old style at regex.c","fromName":"Frank Li","fromEmail":"lznuaa@gmail.com","sentAt":"2009-08-17T16:01:02Z","receivedAt":"2009-08-17T16:01:02Z","isPatch":true,"sender":{"key":"lznuaa@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40642?v=4"},"body":"regerror declare function argument type after function define.\n\nSigned-off-by: Frank Li <lznuaa@gmail.com>\n---\n compat/regex/regex.c |    6 +-----\n 1 files changed, 1 insertions(+), 5 deletions(-)\n\ndiff --git a/compat/regex/regex.c b/compat/regex/regex.c\nindex 5ea0075..5728de1 100644\n--- a/compat/regex/regex.c\n+++ b/compat/regex/regex.c\n@@ -4852,11 +4852,7 @@ regexec (preg, string, nmatch, pmatch, eflags)\n    from either regcomp or regexec.   We don't use PREG here.  */\n \n size_t\n-regerror (errcode, preg, errbuf, errbuf_size)\n-    int errcode;\n-    const regex_t *preg;\n-    char *errbuf;\n-    size_t errbuf_size;\n+regerror (int errcode, const regex_t * preg, char * errbuf,size_t errbuf_size)\n {\n   const char *msg;\n   size_t msg_size;\n-- \n1.6.4.msysgit.0\n"},{"id":"120908","messageId":"1250524872-5148-2-git-send-email-lznuaa@gmail.com","threadId":"20638","inReplyTo":"1250524872-5148-1-git-send-email-lznuaa@gmail.com","subject":"[PATCH 02/11] Fix declare variable at mid of function","fromName":"Frank Li","fromEmail":"lznuaa@gmail.com","sentAt":"2009-08-17T16:01:03Z","receivedAt":"2009-08-17T16:01:03Z","isPatch":true,"sender":{"key":"lznuaa@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40642?v=4"},"body":"Some compiler such as MSVC can't support declear variable at mid of funtion at c file.\n\nSigned-off-by: Frank Li <lznuaa@gmail.com>\n---\n compat/mingw.c |   16 ++++++++++++----\n help.c         |    3 ++-\n run-command.c  |    2 ++\n 3 files changed, 16 insertions(+), 5 deletions(-)\n\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex bed4178..75c74b1 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -123,13 +123,17 @@ int mingw_open (const char *filename, int oflags, ...)\n {\n \tva_list args;\n \tunsigned mode;\n+\tint fd;\n+\n \tva_start(args, oflags);\n \tmode = va_arg(args, int);\n \tva_end(args);\n \n \tif (!strcmp(filename, \"/dev/null\"))\n \t\tfilename = \"nul\";\n-\tint fd = open(filename, oflags, mode);\n+\n+\tfd = open(filename, oflags, mode);\n+\n \tif (fd < 0 && (oflags & O_CREAT) && errno == EACCES) {\n \t\tDWORD attrs = GetFileAttributes(filename);\n \t\tif (attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_DIRECTORY))\n@@ -580,10 +584,11 @@ static char **get_path_split(void)\n \n static void free_path_split(char **path)\n {\n+\tchar **p = path;\n+\n \tif (!path)\n \t\treturn;\n \n-\tchar **p = path;\n \twhile (*p)\n \t\tfree(*p++);\n \tfree(path);\n@@ -1108,9 +1113,11 @@ int sigaction(int sig, struct sigaction *in, struct sigaction *out)\n #undef signal\n sig_handler_t mingw_signal(int sig, sig_handler_t handler)\n {\n+\tsig_handler_t old;\n+\n \tif (sig != SIGALRM)\n \t\treturn signal(sig, handler);\n-\tsig_handler_t old = timer_fn;\n+\told = timer_fn;\n \ttimer_fn = handler;\n \treturn old;\n }\n@@ -1197,8 +1204,9 @@ struct dirent *mingw_readdir(DIR *dir)\n \n \tif (dir->dd_handle == (long)INVALID_HANDLE_VALUE && dir->dd_stat == 0)\n \t{\n+\t\tDWORD lasterr;\n \t\thandle = FindFirstFileA(dir->dd_name, &buf);\n-\t\tDWORD lasterr = GetLastError();\n+\t\tlasterr = GetLastError();\n \t\tdir->dd_handle = (long)handle;\n \t\tif (handle == INVALID_HANDLE_VALUE && (lasterr != ERROR_NO_MORE_FILES)) {\n \t\t\terrno = err_win_to_posix(lasterr);\ndiff --git a/help.c b/help.c\nindex 6c46d8b..399b0b4 100644\n--- a/help.c\n+++ b/help.c\n@@ -127,7 +127,7 @@ static int is_executable(const char *name)\n \t\treturn 0;\n \n #ifdef __MINGW32__\n-\t/* cannot trust the executable bit, peek into the file instead */\n+{\t/* cannot trust the executable bit, peek into the file instead */\n \tchar buf[3] = { 0 };\n \tint n;\n \tint fd = open(name, O_RDONLY);\n@@ -140,6 +140,7 @@ static int is_executable(const char *name)\n \t\t\t\tst.st_mode |= S_IXUSR;\n \t\tclose(fd);\n \t}\n+}\n #endif\n \treturn st.st_mode & S_IXUSR;\n }\ndiff --git a/run-command.c b/run-command.c\nindex ff3d8e2..d1df7ab 100644\n--- a/run-command.c\n+++ b/run-command.c\n@@ -123,6 +123,7 @@ int start_command(struct child_process *cmd)\n \t\texit(127);\n \t}\n #else\n+{\n \tint s0 = -1, s1 = -1, s2 = -1;\t/* backups of stdin, stdout, stderr */\n \tconst char **sargv = cmd->argv;\n \tchar **env = environ;\n@@ -186,6 +187,7 @@ int start_command(struct child_process *cmd)\n \t\tdup2(s1, 1), close(s1);\n \tif (s2 >= 0)\n \t\tdup2(s2, 2), close(s2);\n+}\n #endif\n \n \tif (cmd->pid < 0) {\n-- \n1.6.4.msysgit.0\n"},{"id":"120909","messageId":"1250524872-5148-3-git-send-email-lznuaa@gmail.com","threadId":"20638","inReplyTo":"1250524872-5148-2-git-send-email-lznuaa@gmail.com","subject":"[PATCH 03/11] Define SNPRINTF_SIZE_CORR 1 when use MSVC build git","fromName":"Frank Li","fromEmail":"lznuaa@gmail.com","sentAt":"2009-08-17T16:01:04Z","receivedAt":"2009-08-17T16:01:04Z","isPatch":true,"sender":{"key":"lznuaa@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40642?v=4"},"body":"There are not NUL at vsnprintf verstion of MSVC when rearch max len.\nDefine vsnprintf to _vsnprintf. vsnprintf have deprecated.\n\nSigned-off-by: Frank Li <lznuaa@gmail.com>\n---\n compat/snprintf.c |    7 ++++++-\n 1 files changed, 6 insertions(+), 1 deletions(-)\n\ndiff --git a/compat/snprintf.c b/compat/snprintf.c\nindex 6c0fb05..47b2b8a 100644\n--- a/compat/snprintf.c\n+++ b/compat/snprintf.c\n@@ -6,7 +6,7 @@\n  * number of characters to write without the trailing NUL.\n  */\n #ifndef SNPRINTF_SIZE_CORR\n-#if defined(__MINGW32__) && defined(__GNUC__) && __GNUC__ < 4\n+#if defined(__MINGW32__) && defined(__GNUC__) && __GNUC__ < 4 || defined(_MSC_VER)\n #define SNPRINTF_SIZE_CORR 1\n #else\n #define SNPRINTF_SIZE_CORR 0\n@@ -14,6 +14,11 @@\n #endif\n \n #undef vsnprintf\n+\n+#if defined(_MSC_VER)\n+#define vsnprintf _vsnprintf\n+#endif\n+\n int git_vsnprintf(char *str, size_t maxsize, const char *format, va_list ap)\n {\n \tchar *s;\n-- \n1.6.4.msysgit.0\n"},{"id":"120910","messageId":"1250524872-5148-4-git-send-email-lznuaa@gmail.com","threadId":"20638","inReplyTo":"1250524872-5148-3-git-send-email-lznuaa@gmail.com","subject":"[PATCH 04/11] Add _MSC_VER predefine macro to make same behaviors with __MINGW32__ Enable MSVC build. MSVC have the save behaviors with msysgit.","fromName":"Frank Li","fromEmail":"lznuaa@gmail.com","sentAt":"2009-08-17T16:01:05Z","receivedAt":"2009-08-17T16:01:05Z","isPatch":true,"sender":{"key":"lznuaa@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40642?v=4"},"body":"Signed-off-by: Frank Li <lznuaa@gmail.com>\n---\n help.c        |    2 +-\n pager.c       |    4 ++--\n run-command.c |    8 ++++----\n run-command.h |    2 +-\n setup.c       |    2 +-\n 5 files changed, 9 insertions(+), 9 deletions(-)\n\ndiff --git a/help.c b/help.c\nindex 399b0b4..a311241 100644\n--- a/help.c\n+++ b/help.c\n@@ -126,7 +126,7 @@ static int is_executable(const char *name)\n \t    !S_ISREG(st.st_mode))\n \t\treturn 0;\n \n-#ifdef __MINGW32__\n+#if defined(__MINGW32__) || defined(_MSC_VER)\n {\t/* cannot trust the executable bit, peek into the file instead */\n \tchar buf[3] = { 0 };\n \tint n;\ndiff --git a/pager.c b/pager.c\nindex 4921843..28122c5 100644\n--- a/pager.c\n+++ b/pager.c\n@@ -9,7 +9,7 @@\n \n static int spawned_pager;\n \n-#ifndef __MINGW32__\n+#if !defined(__MINGW32__) && !defined(_MSC_VER)\n static void pager_preexec(void)\n {\n \t/*\n@@ -70,7 +70,7 @@ void setup_pager(void)\n \tpager_argv[2] = pager;\n \tpager_process.argv = pager_argv;\n \tpager_process.in = -1;\n-#ifndef __MINGW32__\n+#if !defined(__MINGW32__) && !defined(_MSC_VER)\n \tpager_process.preexec_cb = pager_preexec;\n #endif\n \tif (start_command(&pager_process))\ndiff --git a/run-command.c b/run-command.c\nindex d1df7ab..df139da 100644\n--- a/run-command.c\n+++ b/run-command.c\n@@ -67,7 +67,7 @@ int start_command(struct child_process *cmd)\n \n \ttrace_argv_printf(cmd->argv, \"trace: run_command:\");\n \n-#ifndef __MINGW32__\n+#if !defined(__MINGW32__) && !defined(_MSC_VER)\n \tfflush(NULL);\n \tcmd->pid = fork();\n \tif (!cmd->pid) {\n@@ -294,7 +294,7 @@ int run_command_v_opt_cd_env(const char **argv, int opt, const char *dir, const\n \treturn run_command(&cmd);\n }\n \n-#ifdef __MINGW32__\n+#if defined(__MINGW32__) || defined(_MSC_VER)\n static __stdcall unsigned run_thread(void *data)\n {\n \tstruct async *async = data;\n@@ -310,7 +310,7 @@ int start_async(struct async *async)\n \t\treturn error(\"cannot create pipe: %s\", strerror(errno));\n \tasync->out = pipe_out[0];\n \n-#ifndef __MINGW32__\n+#if !defined(__MINGW32__) && !defined(_MSC_VER)\n \t/* Flush stdio before fork() to avoid cloning buffers */\n \tfflush(NULL);\n \n@@ -339,7 +339,7 @@ int start_async(struct async *async)\n \n int finish_async(struct async *async)\n {\n-#ifndef __MINGW32__\n+#if !defined(__MINGW32__) && !defined(_MSC_VER)\n \tint ret = 0;\n \n \tif (wait_or_whine(async->pid))\ndiff --git a/run-command.h b/run-command.h\nindex e345502..57a707b 100644\n--- a/run-command.h\n+++ b/run-command.h\n@@ -79,7 +79,7 @@ struct async {\n \tint (*proc)(int fd, void *data);\n \tvoid *data;\n \tint out;\t/* caller reads from here and closes it */\n-#ifndef __MINGW32__\n+#if !defined(__MINGW32__) && !defined(_MSC_VER)\n \tpid_t pid;\n #else\n \tHANDLE tid;\ndiff --git a/setup.c b/setup.c\nindex e3781b6..14e3ca7 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -41,7 +41,7 @@ const char *prefix_path(const char *prefix, int len, const char *path)\n const char *prefix_filename(const char *pfx, int pfx_len, const char *arg)\n {\n \tstatic char path[PATH_MAX];\n-#ifndef __MINGW32__\n+#if !defined(__MINGW32__) && !defined(_MSC_VER)\n \tif (!pfx || !*pfx || is_absolute_path(arg))\n \t\treturn arg;\n \tmemcpy(path, pfx, pfx_len);\n-- \n1.6.4.msysgit.0\n"},{"id":"120924","messageId":"alpine.DEB.1.00.0908171822130.4991@intel-tinevez-2-302","threadId":"20638","inReplyTo":"1250524872-5148-1-git-send-email-lznuaa@gmail.com","subject":"Re: [PATCH 01/11] Fix build failure at VC because function declare use old style at regex.c","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-08-17T16:26:37Z","receivedAt":"2009-08-17T16:26:37Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nreading \"X-Mailer: git-send-email 1.6.4.msysgit.0\" gave me a buzz... well \ndone, Erik!\n\nOn Tue, 18 Aug 2009, Frank Li wrote:\n\n> regerror declare function argument type after function define.\n> \n> Signed-off-by: Frank Li <lznuaa@gmail.com>\n\nHow about\n\n\tAvoid a K&R style function definition in regex.c\n\n\tMicrosoft Visual C++ does not understand K&R notation; use C89 \n\tstyle instead.\n\n?\n\n> diff --git a/compat/regex/regex.c b/compat/regex/regex.c\n> index 5ea0075..5728de1 100644\n> --- a/compat/regex/regex.c\n> +++ b/compat/regex/regex.c\n> @@ -4852,11 +4852,7 @@ regexec (preg, string, nmatch, pmatch, eflags)\n>     from either regcomp or regexec.   We don't use PREG here.  */\n>  \n>  size_t\n> -regerror (errcode, preg, errbuf, errbuf_size)\n> -    int errcode;\n> -    const regex_t *preg;\n> -    char *errbuf;\n> -    size_t errbuf_size;\n> +regerror (int errcode, const regex_t * preg, char * errbuf,size_t errbuf_size)\n\nA cursory look over regex.c gives me the impression that\n\n- it tries to stick to maximally 80 characters per line,\n- there is no space after a * indicating a pointer,\n- there are spaces after all commas,\n- there are a lot more functions with K&R style function definitions than \n  just regerror().\n\nCiao,\nDscho\n"},{"id":"120926","messageId":"alpine.DEB.1.00.0908171827040.4991@intel-tinevez-2-302","threadId":"20638","inReplyTo":"1250524872-5148-2-git-send-email-lznuaa@gmail.com","subject":"Re: [PATCH 02/11] Fix declare variable at mid of function","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-08-17T16:29:03Z","receivedAt":"2009-08-17T16:29:03Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 18 Aug 2009, Frank Li wrote:\n\n> Some compiler such as MSVC can't support declear variable at mid of funtion at c file.\n\nPlease wrap your commit messages after 76 characters.\n\n> \n> Signed-off-by: Frank Li <lznuaa@gmail.com>\n> ---\n\nHow about this instead?\n\n\tAvoid declaration after instruction\n\n\tMicrosoft Visual C++ does not understand this C99 style.\n\n?\n\nThe patch itself is good.\n\nCiao,\nDscho\n"},{"id":"120927","messageId":"alpine.DEB.1.00.0908171829510.4991@intel-tinevez-2-302","threadId":"20638","inReplyTo":"1250524872-5148-3-git-send-email-lznuaa@gmail.com","subject":"Re: [PATCH 03/11] Define SNPRINTF_SIZE_CORR 1 when use MSVC build git","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-08-17T16:32:43Z","receivedAt":"2009-08-17T16:32:43Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 18 Aug 2009, Frank Li wrote:\n\n> There are not NUL at vsnprintf verstion of MSVC when rearch max len.\n> Define vsnprintf to _vsnprintf. vsnprintf have deprecated.\n\nHow about this instead?\n\n\tDefine SNPRINTF_SIZE_CORR=1 for Microsoft Visual C++\n\n\tThe Microsoft C runtime's vsnprintf function does not add NUL at \n\tthe end of the buffer.\n\n\tFurther, Microsoft deprecated vsnprintf in favor of _vsnprintf, so \n\tadd a #define to that end.\n\nThe patch is good, although I suspect that the definition of vsnprintf is \nbetter handled in the precompiler options in .vcproj.\n\nCiao,\nDscho\n"},{"id":"120929","messageId":"3f4fd2640908170934w4c48ada1o66745f845ecb7d49@mail.gmail.com","threadId":"20638","inReplyTo":"alpine.DEB.1.00.0908171827040.4991@intel-tinevez-2-302","subject":"Re: [PATCH 02/11] Fix declare variable at mid of function","fromName":"Reece Dunn","fromEmail":"msclrhd@googlemail.com","sentAt":"2009-08-17T16:34:45Z","receivedAt":"2009-08-17T16:34:45Z","isPatch":true,"sender":{"key":"msclrhd@googlemail.com","avatar":null},"body":"2009/8/17 Johannes Schindelin <Johannes.Schindelin@gmx.de>:\n> Hi,\n>\n> On Tue, 18 Aug 2009, Frank Li wrote:\n>\n>> Some compiler such as MSVC can't support declear variable at mid of funtion at c file.\n>\n> Please wrap your commit messages after 76 characters.\n>\n>>\n>> Signed-off-by: Frank Li <lznuaa@gmail.com>\n>> ---\n>\n> How about this instead?\n>\n>        Avoid declaration after instruction\n>\n>        Microsoft Visual C++ does not understand this C99 style.\n>\n> ?\n>\n> The patch itself is good.\n\nShouldn't GCC be changed to use -std=c89 as well to pick up errors for\ncompilers that don't support c99 (like the Microsoft Visual C++ C\ncompiler)?\n\n- Reece\n"},{"id":"120930","messageId":"alpine.DEB.1.00.0908171835590.4991@intel-tinevez-2-302","threadId":"20638","inReplyTo":"1250524872-5148-4-git-send-email-lznuaa@gmail.com","subject":"Re: [PATCH 04/11] Add _MSC_VER predefine macro to make same behaviors with __MINGW32__ Enable MSVC build. MSVC have the save behaviors with msysgit.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-08-17T16:38:49Z","receivedAt":"2009-08-17T16:38:49Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 18 Aug 2009, Frank Li wrote:\n\n> Signed-off-by: Frank Li <lznuaa@gmail.com>\n\nHow about\n\n\tTest whether WIN32 is defined rather than __MINGW32__\n\n\tThe code which is conditional on MinGW32 is actually conditional \n\ton Windows.  So test WIN32 rather than __MINGW32__.\n\n\tThis does not break Cygwin builds, as WIN32 is undefined there.\n\n\tSuggested by Dmitry Potapov\n\n?\n\nOf course, you have to edit your patch accordingly, then.\n\nAnd yes, I just tested, WIN32 is indeed defined on MinGw32.\n\nCiao,\nDscho\n"},{"id":"120963","messageId":"7v1vnauto6.fsf@alter.siamese.dyndns.org","threadId":"20638","inReplyTo":"alpine.DEB.1.00.0908171827040.4991@intel-tinevez-2-302","subject":"Re: [PATCH 02/11] Fix declare variable at mid of function","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-08-17T19:28:09Z","receivedAt":"2009-08-17T19:28:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> How about this instead?\n>\n> \tAvoid declaration after instruction\n\nIt's called declaration-after-statement.\n\nI always compile with \"-Wall -Wdeclaration-after-statement -Werror\" (among\nother things; if you are interested, see \"Make\" script in 'todo' branch\nfor details) but this being in compat/mingw.c, obviously it is outside of\nmy coverage.\n"},{"id":"120966","messageId":"alpine.DEB.1.00.0908172134150.8306@pacific.mpi-cbg.de","threadId":"20638","inReplyTo":"3f4fd2640908170934w4c48ada1o66745f845ecb7d49@mail.gmail.com","subject":"Re: [PATCH 02/11] Fix declare variable at mid of function","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-08-17T19:36:08Z","receivedAt":"2009-08-17T19:36:08Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 17 Aug 2009, Reece Dunn wrote:\n\n> 2009/8/17 Johannes Schindelin <Johannes.Schindelin@gmx.de>:\n>\n> > On Tue, 18 Aug 2009, Frank Li wrote:\n> >\n> >> Some compiler such as MSVC can't support declear variable at mid of \n> >> funtion at c file.\n> >\n> > Please wrap your commit messages after 76 characters.\n> >\n> >>\n> >> Signed-off-by: Frank Li <lznuaa@gmail.com>\n> >> ---\n> >\n> > How about this instead?\n> >\n> >        Avoid declaration after instruction\n> >\n> >        Microsoft Visual C++ does not understand this C99 style.\n> >\n> > ?\n> >\n> > The patch itself is good.\n> \n> Shouldn't GCC be changed to use -std=c89 as well to pick up errors for \n> compilers that don't support c99 (like the Microsoft Visual C++ C \n> compiler)?\n\nHmm.  I played with the thought of adding -Werror -Wno-pointer-to-int-cast \n-Wold-style-definition -Wdeclaration-after-statement like Junio described \nin one of his mails for MinGW (as we _know_ what compiler we have there).\n\nDunno.\n\nCiao,\nDscho\n"},{"id":"120988","messageId":"alpine.DEB.1.00.0908172258580.8306@pacific.mpi-cbg.de","threadId":"20638","inReplyTo":"7v1vnauto6.fsf@alter.siamese.dyndns.org","subject":"Re: [msysGit] Re: [PATCH 02/11] Fix declare variable at mid of function","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-08-17T21:00:55Z","receivedAt":"2009-08-17T21:00:55Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 17 Aug 2009, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > How about this instead?\n> >\n> > \tAvoid declaration after instruction\n> \n> It's called declaration-after-statement.\n\nOf course.  Thank you.\n\n> I always compile with \"-Wall -Wdeclaration-after-statement -Werror\" \n> (among other things; if you are interested, see \"Make\" script in 'todo' \n> branch for details) but this being in compat/mingw.c, obviously it is \n> outside of my coverage.\n\nI have this in my own tree since long ago, back when you sent a mail whose \nreference I did not record, unfortunately.\n\nOf course, msysGit was not there yet to allow me to compile my tree (and \nmore importantly, pass the test suite), so I did not realize the \nviolations in compat/.\n\nHence my intention to set the compiler flags just after merging the early \ncommits of Frank's work.\n\nCiao,\nDscho\n"},{"id":"120999","messageId":"7vljliqfxr.fsf@alter.siamese.dyndns.org","threadId":"20638","inReplyTo":"alpine.DEB.1.00.0908172258580.8306@pacific.mpi-cbg.de","subject":"Re: [msysGit] Re: [PATCH 02/11] Fix declare variable at mid of function","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-08-17T21:38:24Z","receivedAt":"2009-08-17T21:38:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Of course, msysGit was not there yet to allow me to compile my tree (and \n> more importantly, pass the test suite), so I did not realize the \n> violations in compat/.\n>\n> Hence my intention to set the compiler flags just after merging the early \n> commits of Frank's work.\n\nSounds very sensible.\n"},{"id":"121041","messageId":"1976ea660908171819m38d3524ud174a7e76a171e75@mail.gmail.com","threadId":"20638","inReplyTo":"alpine.DEB.1.00.0908171829510.4991@intel-tinevez-2-302","subject":"Re: [PATCH 03/11] Define SNPRINTF_SIZE_CORR 1 when use MSVC build git","fromName":"Frank Li","fromEmail":"lznuaa@gmail.com","sentAt":"2009-08-18T01:19:26Z","receivedAt":"2009-08-18T01:19:26Z","isPatch":true,"sender":{"key":"lznuaa@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40642?v=4"},"body":"> How about this instead?\n>\n> \tDefine SNPRINTF_SIZE_CORR=1 for Microsoft Visual C++\n>\n> \tThe Microsoft C runtime's vsnprintf function does not add NUL at\n> \tthe end of the buffer.\n>\n> \tFurther, Microsoft deprecated vsnprintf in favor of _vsnprintf, so\n> \tadd a #define to that end.\n\nOf course,  do you need me change commit comment and resend patch?\n\n>\n> The patch is good, although I suspect that the definition of vsnprintf is\n> better handled in the precompiler options in .vcproj.\n>\n\nIf define in .vcproj, it needs copy that to DEBUG\\RELEASE and 32bit\\64bit (2x2)\n4 places. It is easy to miss one.\n\n> Ciao,\n> Dscho\n>\n"},{"id":"121042","messageId":"1976ea660908171829se49abf0j5b7d45a74e4c67a7@mail.gmail.com","threadId":"20638","inReplyTo":"alpine.DEB.1.00.0908171835590.4991@intel-tinevez-2-302","subject":"Re: [PATCH 04/11] Add _MSC_VER predefine macro to make same behaviors with __MINGW32__ Enable MSVC build. MSVC have the save behaviors with msysgit.","fromName":"Frank Li","fromEmail":"lznuaa@gmail.com","sentAt":"2009-08-18T01:29:39Z","receivedAt":"2009-08-18T01:29:39Z","isPatch":true,"sender":{"key":"lznuaa@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40642?v=4"},"body":">\n> \tTest whether WIN32 is defined rather than __MINGW32__\n\nI think WIN32 is better, how about 64bit build case?\nIn 64bit environment, VC define WIN64 not WIN32.\n"},{"id":"121051","messageId":"auto-000020259481@sci.utah.edu","threadId":"20638","inReplyTo":"1976ea660908171829se49abf0j5b7d45a74e4c67a7@mail.gmail.com","subject":"Re: [PATCH 04/11] Add _MSC_VER predefine macro to make same behaviors with __MINGW32__ Enable MSVC build. MSVC have the save behaviors with msysgit.","fromName":"tom fogal","fromEmail":"tfogal@alumni.unh.edu","sentAt":"2009-08-18T05:06:16Z","receivedAt":"2009-08-18T05:06:16Z","isPatch":true,"sender":{"key":"tfogal@alumni.unh.edu","avatar":"https://gravatar.com/avatar/a2f71bfbe12b2b73cad0be2386d554aa403fff7a89df2f79e812c97c7eab0498?d=mp&s=160"},"body":"Frank Li <lznuaa@gmail.com> writes:\n> >\n> > \tTest whether WIN32 is defined rather than __MINGW32__\n> \n> I think WIN32 is better, how about 64bit build case?\n> In 64bit environment, VC define WIN64 not WIN32.\n\nActually, \"_WIN32\" is always defined using `cl', even in 64bit mode.\n64bit compilation additionally defines \"_WIN64\", FWIW.\n\n-tom\n"},{"id":"121053","messageId":"4A8A3ADE.9010703@gmail.com","threadId":"20638","inReplyTo":"alpine.DEB.1.00.0908172134150.8306@pacific.mpi-cbg.de","subject":"Re: [msysGit] Re: [PATCH 02/11] Fix declare variable at mid of function","fromName":"Marius Storm-Olsen","fromEmail":"mstormo@gmail.com","sentAt":"2009-08-18T05:23:42Z","receivedAt":"2009-08-18T05:23:42Z","isPatch":true,"sender":{"key":"mstormo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1500?v=4"},"body":"Johannes Schindelin said the following on 17.08.2009 21:36:\n> Hi,\n> \n> On Mon, 17 Aug 2009, Reece Dunn wrote:\n> \n>> 2009/8/17 Johannes Schindelin <Johannes.Schindelin@gmx.de>:\n>>\n>>> On Tue, 18 Aug 2009, Frank Li wrote:\n>>>\n>>>> Some compiler such as MSVC can't support declear variable at mid of \n>>>> funtion at c file.\n>>> Please wrap your commit messages after 76 characters.\n>>>\n>>>> Signed-off-by: Frank Li <lznuaa@gmail.com>\n>>>> ---\n>>> How about this instead?\n>>>\n>>>        Avoid declaration after instruction\n>>>\n>>>        Microsoft Visual C++ does not understand this C99 style.\n>>>\n>>> ?\n>>>\n>>> The patch itself is good.\n>> Shouldn't GCC be changed to use -std=c89 as well to pick up errors for \n>> compilers that don't support c99 (like the Microsoft Visual C++ C \n>> compiler)?\n> \n> Hmm.  I played with the thought of adding -Werror -Wno-pointer-to-int-cast \n> -Wold-style-definition -Wdeclaration-after-statement like Junio described \n> in one of his mails for MinGW (as we _know_ what compiler we have there).\n> \n> Dunno.\n\nIMO it would be a good change. We should  not have any of those anyways..\n\n--\n.marius\n"},{"id":"121065","messageId":"alpine.DEB.1.00.0908181129100.4680@intel-tinevez-2-302","threadId":"20638","inReplyTo":"1976ea660908171819m38d3524ud174a7e76a171e75@mail.gmail.com","subject":"Re: [PATCH 03/11] Define SNPRINTF_SIZE_CORR 1 when use MSVC build git","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-08-18T09:31:11Z","receivedAt":"2009-08-18T09:31:11Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 18 Aug 2009, Frank Li wrote:\n\n> > How about this instead?\n> >\n> > \tDefine SNPRINTF_SIZE_CORR=1 for Microsoft Visual C++\n> >\n> > \tThe Microsoft C runtime's vsnprintf function does not add NUL at\n> > \tthe end of the buffer.\n> >\n> > \tFurther, Microsoft deprecated vsnprintf in favor of _vsnprintf, so\n> > \tadd a #define to that end.\n> \n> Of course,  do you need me change commit comment and resend patch?\n\nI think it would be best if you could rewrite your vcpatch branch using \nthe new commit message.\n\n> > The patch is good, although I suspect that the definition of vsnprintf \n> > is better handled in the precompiler options in .vcproj.\n> \n> If define in .vcproj, it needs copy that to DEBUG\\RELEASE and \n> 32bit\\64bit (2x2) 4 places. It is easy to miss one.\n\nNo, there are the common precompiler options, too.\n\nBut maybe it is better to leave the #define's in a header file for another \nreason: better visibility (I always hated it that I had to open the \nproject files in a text editor in order to find the settings with Visual \nStudio, the GUI seems to be designed by a fan of hide-and-seek).\n\nCiao,\nDscho\n"},{"id":"121067","messageId":"alpine.DEB.1.00.0908181132470.4680@intel-tinevez-2-302","threadId":"20638","inReplyTo":"4A8A3ADE.9010703@gmail.com","subject":"Re: [msysGit] Re: [PATCH 02/11] Fix declare variable at mid of function","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-08-18T09:34:06Z","receivedAt":"2009-08-18T09:34:06Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 18 Aug 2009, Marius Storm-Olsen wrote:\n\n> Johannes Schindelin said the following on 17.08.2009 21:36:\n> \n> > On Mon, 17 Aug 2009, Reece Dunn wrote:\n> > \n> > > 2009/8/17 Johannes Schindelin <Johannes.Schindelin@gmx.de>:\n> > >\n> > > > On Tue, 18 Aug 2009, Frank Li wrote:\n> > > >\n> > > > > Some compiler such as MSVC can't support declear variable at mid of\n> > > > > funtion at c file.\n> > > > Please wrap your commit messages after 76 characters.\n> > > >\n> > > > > Signed-off-by: Frank Li <lznuaa@gmail.com>\n> > > > > ---\n> > > > How about this instead?\n> > > >\n> > > >        Avoid declaration after instruction\n> > > >\n> > > >        Microsoft Visual C++ does not understand this C99 style.\n> > > >\n> > > > ?\n> > > >\n> > > > The patch itself is good.\n> > > Shouldn't GCC be changed to use -std=c89 as well to pick up errors for\n> > > compilers that don't support c99 (like the Microsoft Visual C++ C\n> > > compiler)?\n> > \n> > Hmm.  I played with the thought of adding -Werror -Wno-pointer-to-int-cast\n> > -Wold-style-definition -Wdeclaration-after-statement like Junio described in\n> > one of his mails for MinGW (as we _know_ what compiler we have there).\n> > \n> > Dunno.\n> \n> IMO it would be a good change. We should  not have any of those anyways..\n\nOkay, I will wait for Frank's updates (just fetched tgit.git and it still \ncontains the old branch), merge the early part and add the compiler flags.\n\nCiao,\nDscho\n"},{"id":"121107","messageId":"1976ea660908180803x416d64a9x87465d1c7e87980e@mail.gmail.com","threadId":"20638","inReplyTo":"alpine.DEB.1.00.0908171822130.4991@intel-tinevez-2-302","subject":"Re: [PATCH 01/11] Fix build failure at VC because function declare use old style at regex.c","fromName":"Frank Li","fromEmail":"lznuaa@gmail.com","sentAt":"2009-08-18T15:03:54Z","receivedAt":"2009-08-18T15:03:54Z","isPatch":true,"sender":{"key":"lznuaa@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40642?v=4"},"body":" - there are a lot more functions with K&R style function definitions than\n>  just regerror().\n>\n\nI double check it. VC can compile K&R style function. This patch is redundancy\n"},{"id":"121113","messageId":"1976ea660908180911m7469ac20w48a28b90262d25f6@mail.gmail.com","threadId":"20638","inReplyTo":"alpine.DEB.1.00.0908181132470.4680@intel-tinevez-2-302","subject":"Re: [msysGit] Re: [PATCH 02/11] Fix declare variable at mid of function","fromName":"Frank Li","fromEmail":"lznuaa@gmail.com","sentAt":"2009-08-18T16:11:48Z","receivedAt":"2009-08-18T16:11:48Z","isPatch":true,"sender":{"key":"lznuaa@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40642?v=4"},"body":"> Okay, I will wait for Frank's updates (just fetched tgit.git and it still\n> contains the old branch), merge the early part and add the compiler flags.\n>\nToday, I just update 5 patch according review feedback.\nDo I need send it again?\n\nI have push my change to tgit\ngit://repo.or.cz/tgit.git\nbranch vcpatch2\n\nHow do I know if patch has been applied main line?\n"},{"id":"121125","messageId":"vpqr5v93vzq.fsf@bauges.imag.fr","threadId":"20638","inReplyTo":"1976ea660908180911m7469ac20w48a28b90262d25f6@mail.gmail.com","subject":"Re: [msysGit] Re: [PATCH 02/11] Fix declare variable at mid of function","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2009-08-18T16:52:25Z","receivedAt":"2009-08-18T16:52:25Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Frank Li <lznuaa@gmail.com> writes:\n\n>> Okay, I will wait for Frank's updates (just fetched tgit.git and it still\n>> contains the old branch), merge the early part and add the compiler flags.\n>>\n> Today, I just update 5 patch according review feedback.\n> Do I need send it again?\n\nYes, this is the use here. Preferably edit the message to replace\n[PATCH] with [PATCH v2] or so.\n\n> How do I know if patch has been applied main line?\n\nAnswering the question with another: shouldn't we add a section like\nthis to SubmittingPatches ?\n\n>From 3ee45ab5992fd084c130460f07454061ce3cf057 Mon Sep 17 00:00:00 2001\nFrom: Matthieu Moy <Matthieu.Moy@imag.fr>\nDate: Tue, 18 Aug 2009 18:48:47 +0200\nSubject: [PATCH] SubmittingPatches: draft section to know patches status\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n Documentation/SubmittingPatches |   14 ++++++++++++++\n 1 files changed, 14 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches\nindex 76fc84d..c686f86 100644\n--- a/Documentation/SubmittingPatches\n+++ b/Documentation/SubmittingPatches\n@@ -280,6 +280,20 @@ people play with it without having to pick up and apply the patch to\n their trees themselves.\n \n ------------------------------------------------\n+Know the status of your patch after submission\n+\n+* You can use Git itself to find out when your patch is merged in\n+  master. 'git pull --rebase' will automatically skip already-applied\n+  patches, and will let you know. This works only if you rebase on top\n+  of the branch in which your patch has been merged (i.e. it will not\n+  tell you if your patch is merged in pu if you rebase on top of\n+  master).\n+\n+* Read the git mailing list, the maintainer regularly posts messages\n+  entitled \"What's cooking in git.git\" and \"What's in git.git\" giving\n+  the status of various proposed changes.\n+\n+------------------------------------------------\n MUA specific hints\n \n Some of patches I receive or pick up from the list share common\n-- \n1.6.4.313.g38b9\n\n\n\n-- \nMatthieu\n"},{"id":"121237","messageId":"alpine.DEB.1.00.0908191158310.5594@intel-tinevez-2-302","threadId":"20638","inReplyTo":"1976ea660908180911m7469ac20w48a28b90262d25f6@mail.gmail.com","subject":"Re: [msysGit] Re: [PATCH 02/11] Fix declare variable at mid of function","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-08-19T10:15:42Z","receivedAt":"2009-08-19T10:15:42Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\n\nOn Wed, 19 Aug 2009, Frank Li wrote:\n\n> > Okay, I will wait for Frank's updates (just fetched tgit.git and it still\n> > contains the old branch), merge the early part and add the compiler flags.\n> >\n> Today, I just update 5 patch according review feedback.\n> Do I need send it again?\n> \n> I have push my change to tgit\n> git://repo.or.cz/tgit.git\n> branch vcpatch2\n> \n> How do I know if patch has been applied main line?\n\nI applied them to 4msysgit.git's devel.  Note that I had a strange merge \nconflict in pager.c: you replaced and #ifndef __MINGW32__ with an #ifndef \nWIN32, but I don't have that #ifndef at all.\n\nCiao,\nDscho\n"},{"id":"121239","messageId":"4A8BDA2A.9030105@viscovery.net","threadId":"20638","inReplyTo":"alpine.DEB.1.00.0908191158310.5594@intel-tinevez-2-302","subject":"Re: [msysGit] Re: [PATCH 02/11] Fix declare variable at mid of function","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-08-19T10:55:38Z","receivedAt":"2009-08-19T10:55:38Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Johannes Schindelin schrieb:\n> On Wed, 19 Aug 2009, Frank Li wrote:\n>> I have push my change to tgit\n>> git://repo.or.cz/tgit.git\n>> branch vcpatch2\n>>\n>> How do I know if patch has been applied main line?\n> \n> I applied them to 4msysgit.git's devel.  Note that I had a strange merge \n> conflict in pager.c: you replaced and #ifndef __MINGW32__ with an #ifndef \n> WIN32, but I don't have that #ifndef at all.\n\n4msysgit has my \"Windows: Better support PAGER settings with spaces in the\npath\", which removes the #ifndefs, Frank's version doesn't have it.\nTherefore, you should not rebase Frank's patches on top of 4msysgit's\nmaster or devel before they are merged into git.git.\n\n-- Hannes\n"},{"id":"121249","messageId":"alpine.DEB.1.00.0908191514020.5594@intel-tinevez-2-302","threadId":"20638","inReplyTo":"4A8BDA2A.9030105@viscovery.net","subject":"Re: [PATCH 02/11] Fix declare variable at mid of function","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-08-19T13:15:01Z","receivedAt":"2009-08-19T13:15:01Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nHi,\n\nOn Wed, 19 Aug 2009, Johannes Sixt wrote:\n\n> Johannes Schindelin schrieb:\n> > On Wed, 19 Aug 2009, Frank Li wrote:\n> >> I have push my change to tgit\n> >> git://repo.or.cz/tgit.git\n> >> branch vcpatch2\n> >>\n> >> How do I know if patch has been applied main line?\n> > \n> > I applied them to 4msysgit.git's devel.  Note that I had a strange \n> > merge conflict in pager.c: you replaced and #ifndef __MINGW32__ with \n> > an #ifndef WIN32, but I don't have that #ifndef at all.\n> \n> 4msysgit has my \"Windows: Better support PAGER settings with spaces in \n> the path\", which removes the #ifndefs, Frank's version doesn't have it. \n> Therefore, you should not rebase Frank's patches on top of 4msysgit's \n> master or devel before they are merged into git.git.\n\nWell, I wanted to give them a little bit more visibility by putting them \ninto 4msysgit.git, as I think the best way to get Microsoft Visual C++ \nsupport into git.git _is_ via 4msysgit.git.\n\nCiao,\nDscho\n"},{"id":"121256","messageId":"4A8C1879.2070807@viscovery.net","threadId":"20638","inReplyTo":"alpine.DEB.1.00.0908191514020.5594@intel-tinevez-2-302","subject":"Re: [msysGit] Re: [PATCH 02/11] Fix declare variable at mid of function","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-08-19T15:21:29Z","receivedAt":"2009-08-19T15:21:29Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Johannes Schindelin schrieb:\n> On Wed, 19 Aug 2009, Johannes Sixt wrote:\n>> Johannes Schindelin schrieb:\n>>> On Wed, 19 Aug 2009, Frank Li wrote:\n>>>> I have push my change to tgit\n>>>> git://repo.or.cz/tgit.git\n>>>> branch vcpatch2\n>>>>\n>>>> How do I know if patch has been applied main line?\n>>> I applied them to 4msysgit.git's devel.  Note that I had a strange \n>>> merge conflict in pager.c: you replaced and #ifndef __MINGW32__ with \n>>> an #ifndef WIN32, but I don't have that #ifndef at all.\n>> 4msysgit has my \"Windows: Better support PAGER settings with spaces in \n>> the path\", which removes the #ifndefs, Frank's version doesn't have it. \n>> Therefore, you should not rebase Frank's patches on top of 4msysgit's \n>> master or devel before they are merged into git.git.\n> \n> Well, I wanted to give them a little bit more visibility by putting them \n> into 4msysgit.git, as I think the best way to get Microsoft Visual C++ \n> support into git.git _is_ via 4msysgit.git.\n\nEven more so should you keep the original patches (in this case at least),\nnot rebased ones. It is unlikely that \"Windows: Better support PAGER...\"\nwill be in git.git _before_ Frank's MINGW32->WIN32 conversion patch.\n\n-- Hannes\n"}]}