{"thread":{"id":"15220","subject":"[PATCH 0/2] Improve portability for OpenSolaris","startedAt":"2008-08-27T17:39:01Z","lastAt":"2008-08-31T07:15:10Z","messageCount":9,"participants":["David Soria Parra","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"88737","messageId":"1219858743-4476-1-git-send-email-sn_@gmx.net","threadId":"15220","inReplyTo":null,"subject":"[PATCH 0/2] Improve portability for OpenSolaris","fromName":"David Soria Parra","fromEmail":"sn_@gmx.net","sentAt":"2008-08-27T17:39:01Z","receivedAt":"2008-08-27T17:39:01Z","isPatch":true,"sender":{"key":"sn_@gmx.net","avatar":"https://gravatar.com/avatar/b1075ecdd33ea094cbc23798fe8b95c73ec1ccf7bb213ac8260c719e2dd97b55?d=mp&s=160"},"body":"This small patch series fixes some compile warnings on OpenSolaris/Solaris.\nAs pid_t is a long on Solaris, I changed the output of fprintf&co to longs\nand cast pids to long, so that we are safe on the solaris\n"},{"id":"88738","messageId":"1219858743-4476-2-git-send-email-sn_@gmx.net","threadId":"15220","inReplyTo":"1219858743-4476-1-git-send-email-sn_@gmx.net","subject":"[PATCH 1/2] Improvate portability: Display pid_t's always as long","fromName":"David Soria Parra","fromEmail":"sn_@gmx.net","sentAt":"2008-08-27T17:39:02Z","receivedAt":"2008-08-27T17:39:02Z","isPatch":true,"sender":{"key":"sn_@gmx.net","avatar":"https://gravatar.com/avatar/b1075ecdd33ea094cbc23798fe8b95c73ec1ccf7bb213ac8260c719e2dd97b55?d=mp&s=160"},"body":"From: David Soria Parra <dsp@php.net>\n\nSome systems (like e.g. OpenSolaris) define pid_t as long,\ntherefore all our sprintf that use %i cause a compiler warning\nbeacuse if the implicit long->int cast. So to make sure that\nwe fit the limits we display pids as longs and cast them explicitly.\n\nSigned-off-by: David Soria Parra <dsp@php.net>\n---\n builtin-commit.c     |    2 +-\n builtin-fetch-pack.c |    2 +-\n daemon.c             |    2 +-\n fast-import.c        |    6 +++---\n receive-pack.c       |    2 +-\n 5 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex 649c8be..b4c940f 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -320,7 +320,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix)\n \t\tdie(\"unable to write new_index file\");\n \n \tfd = hold_lock_file_for_update(&false_lock,\n-\t\t\t\t       git_path(\"next-index-%d\", getpid()), 1);\n+\t\t\t\t       git_path(\"next-index-%ld\", (long) getpid()), 1);\n \n \tcreate_base_index();\n \tadd_remove_files(&partial);\ndiff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c\nindex 273239a..46bb3e2 100644\n--- a/builtin-fetch-pack.c\n+++ b/builtin-fetch-pack.c\n@@ -540,7 +540,7 @@ static int get_pack(int xd[2], char **pack_lockfile)\n \t\t\t*av++ = \"--fix-thin\";\n \t\tif (args.lock_pack || unpack_limit) {\n \t\t\tint s = sprintf(keep_arg,\n-\t\t\t\t\t\"--keep=fetch-pack %d on \", getpid());\n+\t\t\t\t\t\"--keep=fetch-pack %ld on \", (long) getpid());\n \t\t\tif (gethostname(keep_arg + s, sizeof(keep_arg) - s))\n \t\t\t\tstrcpy(keep_arg + s, \"localhost\");\n \t\t\t*av++ = keep_arg;\ndiff --git a/daemon.c b/daemon.c\nindex 23278e2..1e5cb58 100644\n--- a/daemon.c\n+++ b/daemon.c\n@@ -923,7 +923,7 @@ static void store_pid(const char *path)\n \tFILE *f = fopen(path, \"w\");\n \tif (!f)\n \t\tdie(\"cannot open pid file %s: %s\", path, strerror(errno));\n-\tif (fprintf(f, \"%d\\n\", getpid()) < 0 || fclose(f) != 0)\n+\tif (fprintf(f, \"%ld\\n\", (long) getpid()) < 0 || fclose(f) != 0)\n \t\tdie(\"failed to write pid file %s: %s\", path, strerror(errno));\n }\n \ndiff --git a/fast-import.c b/fast-import.c\nindex 7089e6f..e04ed94 100644\n--- a/fast-import.c\n+++ b/fast-import.c\n@@ -376,7 +376,7 @@ static void dump_marks_helper(FILE *, uintmax_t, struct mark_set *);\n \n static void write_crash_report(const char *err)\n {\n-\tchar *loc = git_path(\"fast_import_crash_%d\", getpid());\n+\tchar *loc = git_path(\"fast_import_crash_%ld\", (long) getpid());\n \tFILE *rpt = fopen(loc, \"w\");\n \tstruct branch *b;\n \tunsigned long lu;\n@@ -390,8 +390,8 @@ static void write_crash_report(const char *err)\n \tfprintf(stderr, \"fast-import: dumping crash report to %s\\n\", loc);\n \n \tfprintf(rpt, \"fast-import crash report:\\n\");\n-\tfprintf(rpt, \"    fast-import process: %d\\n\", getpid());\n-\tfprintf(rpt, \"    parent process     : %d\\n\", getppid());\n+\tfprintf(rpt, \"    fast-import process: %ld\\n\", (long) getpid());\n+\tfprintf(rpt, \"    parent process     : %ld\\n\", (long) getppid());\n \tfprintf(rpt, \"    at %s\\n\", show_date(time(NULL), 0, DATE_LOCAL));\n \tfputc('\\n', rpt);\n \ndiff --git a/receive-pack.c b/receive-pack.c\nindex d44c19e..0a82f73 100644\n--- a/receive-pack.c\n+++ b/receive-pack.c\n@@ -407,7 +407,7 @@ static const char *unpack(void)\n \t\tchar keep_arg[256];\n \t\tstruct child_process ip;\n \n-\t\ts = sprintf(keep_arg, \"--keep=receive-pack %i on \", getpid());\n+\t\ts = sprintf(keep_arg, \"--keep=receive-pack %li on \", (long) getpid());\n \t\tif (gethostname(keep_arg + s, sizeof(keep_arg) - s))\n \t\t\tstrcpy(keep_arg + s, \"localhost\");\n \n-- \n1.6.0.174.gd789c\n"},{"id":"88739","messageId":"1219858743-4476-3-git-send-email-sn_@gmx.net","threadId":"15220","inReplyTo":"1219858743-4476-2-git-send-email-sn_@gmx.net","subject":"[PATCH 2/2] Improve portability: Avoid SS constant as it is already defined","fromName":"David Soria Parra","fromEmail":"sn_@gmx.net","sentAt":"2008-08-27T17:39:03Z","receivedAt":"2008-08-27T17:39:03Z","isPatch":true,"sender":{"key":"sn_@gmx.net","avatar":"https://gravatar.com/avatar/b1075ecdd33ea094cbc23798fe8b95c73ec1ccf7bb213ac8260c719e2dd97b55?d=mp&s=160"},"body":"From: David Soria Parra <dsp@php.net>\n\nConstants that have the names of CPU registers are already defined\nin OpenSolaris's sys/regset.h. This causes a warning as we try to\n(re)define SS in ctype.c. So we just use another name.\n\nSigned-off-by: David Soria Parra <dsp@php.net>\n---\n ctype.c |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/ctype.c b/ctype.c\nindex ee06eb7..6ed2ba2 100644\n--- a/ctype.c\n+++ b/ctype.c\n@@ -5,14 +5,14 @@\n  */\n #include \"cache.h\"\n \n-#define SS GIT_SPACE\n+#define SP GIT_SPACE\n #define AA GIT_ALPHA\n #define DD GIT_DIGIT\n \n unsigned char sane_ctype[256] = {\n-\t 0,  0,  0,  0,  0,  0,  0,  0,  0, SS, SS,  0,  0, SS,  0,  0,\t\t/* 0-15 */\n+\t 0,  0,  0,  0,  0,  0,  0,  0,  0, SP, SP,  0,  0, SP,  0,  0,\t\t/* 0-15 */\n \t 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,\t\t/* 16-15 */\n-\tSS,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,\t\t/* 32-15 */\n+\tSP,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,\t\t/* 32-15 */\n \tDD, DD, DD, DD, DD, DD, DD, DD, DD, DD,  0,  0,  0,  0,  0,  0,\t\t/* 48-15 */\n \t 0, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA,\t\t/* 64-15 */\n \tAA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA,  0,  0,  0,  0,  0,\t\t/* 80-15 */\n-- \n1.6.0.174.gd789c\n"},{"id":"88755","messageId":"7vwsi2p9qk.fsf@gitster.siamese.dyndns.org","threadId":"15220","inReplyTo":"1219858743-4476-3-git-send-email-sn_@gmx.net","subject":"Re: [PATCH 2/2] Improve portability: Avoid SS constant as it is already defined","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-27T18:56:51Z","receivedAt":"2008-08-27T18:56:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Soria Parra <sn_@gmx.net> writes:\n\n> From: David Soria Parra <dsp@php.net>\n>\n> Constants that have the names of CPU registers are already defined\n> in OpenSolaris's sys/regset.h. This causes a warning as we try to\n> (re)define SS in ctype.c. So we just use another name.\n\nI do not mind this _particular_ workaround per-se, but I have to wonder\nwhat happens the next time some random other platform has \"SP\" defined in\na random header file.\n\nFirst of all, why are you including <sys/regset.h>?  We certainly don't\ninclude from any of our header or source files.  And second of all, why is\nthe indirect inclusion of that header file by some standard header file we\ndo include cause the namespace to get poluted with \"SS\" symbol?\n"},{"id":"88756","messageId":"7vsksqp9f1.fsf@gitster.siamese.dyndns.org","threadId":"15220","inReplyTo":"1219858743-4476-2-git-send-email-sn_@gmx.net","subject":"Re: [PATCH 1/2] Improvate portability: Display pid_t's always as long","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-27T19:03:46Z","receivedAt":"2008-08-27T19:03:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Soria Parra <sn_@gmx.net> writes:\n\n> Some systems (like e.g. OpenSolaris) define pid_t as long,\n> therefore all our sprintf that use %i cause a compiler warning\n> beacuse if the implicit long->int cast. So to make sure that\n> we fit the limits we display pids as longs and cast them explicitly.\n\nThis patch just makes one wonder what needs to happen when the next random\nplatform has pid_t as long long or int32_t or whatever signed integral\ntype that was picked arbitrarily by the platform.\n\nI think these *printf()s are mostly for informational purposes and if you\nfavor minimum change, you might be better off casting it to \"int\" without\nchanging the format specifiers.\n\nOn the other hand, if you are shooting for maximum compatibility perhaps\nyou may want to cast it to \"intmax_t\" and format as such.\n\nCasting to \"long\" does not make much sense from either perspective, does\nit?\n"},{"id":"88759","messageId":"7vod3ep8sn.fsf@gitster.siamese.dyndns.org","threadId":"15220","inReplyTo":"7vwsi2p9qk.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 2/2] Improve portability: Avoid SS constant as it is already defined","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-27T19:17:12Z","receivedAt":"2008-08-27T19:17:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> David Soria Parra <sn_@gmx.net> writes:\n>\n>> From: David Soria Parra <dsp@php.net>\n>>\n>> Constants that have the names of CPU registers are already defined\n>> in OpenSolaris's sys/regset.h. This causes a warning as we try to\n>> (re)define SS in ctype.c. So we just use another name.\n>\n> I do not mind this _particular_ workaround per-se, but I have to wonder\n> what happens the next time some random other platform has \"SP\" defined in\n> a random header file.\n\nIf we are doing an workaround, how about doing it this way instead?\n\n ctype.c |    5 +++++\n 1 files changed, 5 insertions(+), 0 deletions(-)\n\ndiff --git i/ctype.c w/ctype.c\nindex ee06eb7..d2bd38e 100644\n--- i/ctype.c\n+++ w/ctype.c\n@@ -5,6 +5,11 @@\n  */\n #include \"cache.h\"\n \n+/* Just so that no insane platform contaminates the namespace with these symbols */\n+#undef SS\n+#undef AA\n+#undef DD\n+\n #define SS GIT_SPACE\n #define AA GIT_ALPHA\n #define DD GIT_DIGIT\n"},{"id":"88835","messageId":"48B5F29D.3040306@gmx.net","threadId":"15220","inReplyTo":"7vod3ep8sn.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 2/2] Improve portability: Avoid SS constant as it is already defined","fromName":"David Soria Parra","fromEmail":"dsoria@gmx.net","sentAt":"2008-08-28T00:34:37Z","receivedAt":"2008-08-28T00:34:37Z","isPatch":true,"sender":{"key":"dsoria@gmx.net","avatar":null},"body":"Should be fine as well.\n\nJunio C Hamano wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n>> David Soria Parra <sn_@gmx.net> writes:\n>>\n>>> From: David Soria Parra <dsp@php.net>\n>>>\n>>> Constants that have the names of CPU registers are already defined\n>>> in OpenSolaris's sys/regset.h. This causes a warning as we try to\n>>> (re)define SS in ctype.c. So we just use another name.\n>> I do not mind this _particular_ workaround per-se, but I have to wonder\n>> what happens the next time some random other platform has \"SP\" defined in\n>> a random header file.\n> \n> If we are doing an workaround, how about doing it this way instead?\n> \n>  ctype.c |    5 +++++\n>  1 files changed, 5 insertions(+), 0 deletions(-)\n> \n> diff --git i/ctype.c w/ctype.c\n> index ee06eb7..d2bd38e 100644\n> --- i/ctype.c\n> +++ w/ctype.c\n> @@ -5,6 +5,11 @@\n>   */\n>  #include \"cache.h\"\n>  \n> +/* Just so that no insane platform contaminates the namespace with these symbols */\n> +#undef SS\n> +#undef AA\n> +#undef DD\n> +\n>  #define SS GIT_SPACE\n>  #define AA GIT_ALPHA\n>  #define DD GIT_DIGIT\n"},{"id":"89252","messageId":"48B9B03F.1080304@gmx.net","threadId":"15220","inReplyTo":"7vsksqp9f1.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 1/2] Improvate portability: Display pid_t's always as long","fromName":"David Soria Parra","fromEmail":"dsoria@gmx.net","sentAt":"2008-08-30T20:40:31Z","receivedAt":"2008-08-30T20:40:31Z","isPatch":true,"sender":{"key":"dsoria@gmx.net","avatar":null},"body":"\n > On the other hand, if you are shooting for maximum compatibility perhaps\n > you may want to cast it to \"intmax_t\" and format as such.\nYes, good point, casting to long isn't enough. I think it's a good approach to cast the pids to intmax_t as pids\nare also used in git_path() and therefore might result in equal paths for separate processes if\nthe pid is higher than int.\n\nso here is an updated patch:\n\n From da5519b3ae5ce84c703aeaab2bc4ea363897c334 Mon Sep 17 00:00:00 2001\nFrom: David Soria Parra <dsp at>\nDate: Fri, 29 Aug 2008 01:19:43 +0200\nSubject: [PATCH] Improvate portability: Cast pid_t's to intmax_t\n\nSome systems (like e.g. OpenSolaris) define pid_t as long,\ntherefore all our sprintf that use %i cause a compiler warning\nbeacuse if the implicit long->int cast. So to make sure that\nwe fit the limits we display pids as intmax_t and cast them explicitly.\n\nSigned-off-by: David Soria Parra <dsp@php.net>\n---\n  builtin-commit.c     |    2 +-\n  builtin-fetch-pack.c |    2 +-\n  daemon.c             |    6 +++---\n  fast-import.c        |    6 +++---\n  receive-pack.c       |    2 +-\n  5 files changed, 9 insertions(+), 9 deletions(-)\n\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex c870037..90ef3d5 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -320,7 +320,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix)\n  \t\tdie(\"unable to write new_index file\");\n\n  \tfd = hold_lock_file_for_update(&false_lock,\n-\t\t\t\t       git_path(\"next-index-%d\", getpid()), 1);\n+\t\t\t\t       git_path(\"next-index-%jd\", (intmax_t) getpid()), 1);\n\n  \tcreate_base_index();\n  \tadd_remove_files(&partial);\ndiff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c\nindex 273239a..91616e7 100644\n--- a/builtin-fetch-pack.c\n+++ b/builtin-fetch-pack.c\n@@ -540,7 +540,7 @@ static int get_pack(int xd[2], char **pack_lockfile)\n  \t\t\t*av++ = \"--fix-thin\";\n  \t\tif (args.lock_pack || unpack_limit) {\n  \t\t\tint s = sprintf(keep_arg,\n-\t\t\t\t\t\"--keep=fetch-pack %d on \", getpid());\n+\t\t\t\t\t\"--keep=fetch-pack %jd on \", (intmax_t) getpid());\n  \t\t\tif (gethostname(keep_arg + s, sizeof(keep_arg) - s))\n  \t\t\t\tstrcpy(keep_arg + s, \"localhost\");\n  \t\t\t*av++ = keep_arg;\ndiff --git a/daemon.c b/daemon.c\nindex 23278e2..6081986 100644\n--- a/daemon.c\n+++ b/daemon.c\n@@ -86,7 +86,7 @@ static void logreport(int priority, const char *err, va_list params)\n  \t\t * Since stderr is set to linebuffered mode, the\n  \t\t * logging of different processes will not overlap\n  \t\t */\n-\t\tfprintf(stderr, \"[%d] \", (int)getpid());\n+\t\tfprintf(stderr, \"[%jd] \", (intmax_t)getpid());\n  \t\tvfprintf(stderr, err, params);\n  \t\tfputc('\\n', stderr);\n  \t}\n@@ -658,7 +658,7 @@ static void check_dead_children(void)\n  \t\tremove_child(pid);\n  \t\tif (!WIFEXITED(status) || (WEXITSTATUS(status) > 0))\n  \t\t\tdead = \" (with error)\";\n-\t\tloginfo(\"[%d] Disconnected%s\", (int)pid, dead);\n+\t\tloginfo(\"[%jd] Disconnected%s\", (intmax_t)pid, dead);\n  \t}\n  }\n\n@@ -923,7 +923,7 @@ static void store_pid(const char *path)\n  \tFILE *f = fopen(path, \"w\");\n  \tif (!f)\n  \t\tdie(\"cannot open pid file %s: %s\", path, strerror(errno));\n-\tif (fprintf(f, \"%d\\n\", getpid()) < 0 || fclose(f) != 0)\n+\tif (fprintf(f, \"%jd\\n\", (intmax_t) getpid()) < 0 || fclose(f) != 0)\n  \t\tdie(\"failed to write pid file %s: %s\", path, strerror(errno));\n  }\n\ndiff --git a/fast-import.c b/fast-import.c\nindex 7089e6f..e3a6510 100644\n--- a/fast-import.c\n+++ b/fast-import.c\n@@ -376,7 +376,7 @@ static void dump_marks_helper(FILE *, uintmax_t, struct mark_set *);\n\n  static void write_crash_report(const char *err)\n  {\n-\tchar *loc = git_path(\"fast_import_crash_%d\", getpid());\n+\tchar *loc = git_path(\"fast_import_crash_%jd\", (intmax_t) getpid());\n  \tFILE *rpt = fopen(loc, \"w\");\n  \tstruct branch *b;\n  \tunsigned long lu;\n@@ -390,8 +390,8 @@ static void write_crash_report(const char *err)\n  \tfprintf(stderr, \"fast-import: dumping crash report to %s\\n\", loc);\n\n  \tfprintf(rpt, \"fast-import crash report:\\n\");\n-\tfprintf(rpt, \"    fast-import process: %d\\n\", getpid());\n-\tfprintf(rpt, \"    parent process     : %d\\n\", getppid());\n+\tfprintf(rpt, \"    fast-import process: %jd\\n\", (intmax_t) getpid());\n+\tfprintf(rpt, \"    parent process     : %jd\\n\", (intmax_t) getppid());\n  \tfprintf(rpt, \"    at %s\\n\", show_date(time(NULL), 0, DATE_LOCAL));\n  \tfputc('\\n', rpt);\n\ndiff --git a/receive-pack.c b/receive-pack.c\nindex d44c19e..ec770d0 100644\n--- a/receive-pack.c\n+++ b/receive-pack.c\n@@ -407,7 +407,7 @@ static const char *unpack(void)\n  \t\tchar keep_arg[256];\n  \t\tstruct child_process ip;\n\n-\t\ts = sprintf(keep_arg, \"--keep=receive-pack %i on \", getpid());\n+\t\ts = sprintf(keep_arg, \"--keep=receive-pack %ji on \", (intmax_t) getpid());\n  \t\tif (gethostname(keep_arg + s, sizeof(keep_arg) - s))\n  \t\t\tstrcpy(keep_arg + s, \"localhost\");\n\n-- \n1.6.0.174.gd789c\n"},{"id":"89293","messageId":"7vtzd1bqpt.fsf@gitster.siamese.dyndns.org","threadId":"15220","inReplyTo":"48B9B03F.1080304@gmx.net","subject":"Re: [PATCH 1/2] Improvate portability: Display pid_t's always as long","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-31T07:15:10Z","receivedAt":"2008-08-31T07:15:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Soria Parra <dsoria@gmx.net> writes:\n\n>> On the other hand, if you are shooting for maximum compatibility perhaps\n>> you may want to cast it to \"intmax_t\" and format as such.\n> Yes, good point, casting to long isn't enough. I think it's a good approach to cast the pids to intmax_t as pids\n> are also used in git_path() and therefore might result in equal paths for separate processes if\n> the pid is higher than int.\n>\n> so here is an updated patch:\n\nPlease wrap lines to reasonable length (e.g. 70-76 cols).\n\nPlease move commentary like this that clarifies context of the patch\nsubmission to after three-dashes (emulate patches from people with good\nmanners).\n\n> From da5519b3ae5ce84c703aeaab2bc4ea363897c334 Mon Sep 17 00:00:00 2001\n\nEspecially, don't paste this line.\n\n> From: David Soria Parra <dsp at>\n> Date: Fri, 29 Aug 2008 01:19:43 +0200\n> Subject: [PATCH] Improvate portability: Cast pid_t's to intmax_t\n\n\"Improvate\"?\n\nIncluding these in your message is not very useful.  These in-body headers\nare used to override what can be read from the real headers of the e-mail\nmessage, but you do not have a valid e-mail address here!\n\n> Some systems (like e.g. OpenSolaris) define pid_t as long,\n> ...\n> diff --git a/builtin-commit.c b/builtin-commit.c\n> index c870037..90ef3d5 100644\n> --- a/builtin-commit.c\n> +++ b/builtin-commit.c\n> @@ -320,7 +320,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix)\n>  \t\tdie(\"unable to write new_index file\");\n>\n>  \tfd = hold_lock_file_for_update(&false_lock,\n> -\t\t\t\t       git_path(\"next-index-%d\", getpid()), 1);\n> +\t\t\t\t       git_path(\"next-index-%jd\", (intmax_t) getpid()), 1);\n\nSome systems we support do not have %j width specifier.  I'd suggest\ncasting up to uintmax_t and format with PRIuMAX, which we do define\na substitute for portability.\n"}]}