git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Git, C89, and older compilers

From
JJJoshua Juran <jjuran@gmail.com>
Date
Mar 31, 2009, 19:26 UTC
Message-ID
<9D199AAA-5EC6-4E7C-AC26-0CDA68341D00@gmail.com>
Hello,

I'm porting Git to Lamp (Lamp ain't Mac POSIX), a Unix-like environment which runs in classic Mac OS, much like Cygwin.

One of the complications I've run into is that Metrowerks C 2.4.1 (released in 2001) doesn't support some of the constructs git uses, such as initializing an aggregate's member with the address of a local variable, illustrated by the patch below:

diff --git a/builtin-commit.c b/builtin-commit.c
index 46e649c..8b98547 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -605,7 +605,8 @@ static int prepare_to_commit(const char  
*index_file, const c

         if (use_editor) {
                 char index[PATH_MAX];
-               const char *env[2] = { index, NULL };
+               const char *env[2] = { NULL, NULL };
+               env[0] = index;
                 snprintf(index, sizeof(index), "GIT_INDEX_FILE=%s",  
index_file);
                 if (launch_editor(git_path(commit_editmsg), NULL,  
env)) {
                         fprintf(stderr,

Is git intended to compile on a C89 compiler?  In any case, if I  
produce a complete set of patches, will they be applied?

Josh
Next: Jay Soffian
Message 1 of 3 in “Git, C89, and older compilers”
  1. Joshua JuranMar 31, 2009
  2. Jay SoffianMar 31, 2009
  3. Joshua JuranMar 31, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.