threads / patch / 13835

patchThis patch is to allow 12 different OS's to compile and run git.

Subject: [PATCH] This patch is to allow 12 different OS's to compile and run git.

## tl;dr

24 messages between Jun 6, 2008 and Jun 8, 2008. Diffs are folded; open one to read it.

replies: 23people: 8as markdown or json

Boyd Lynn Gerber· Jun 6, 2008, 19:34 UTC · lore
This patch has patches to

Makefile git-compat-util.h progress.c

This patch allows some older OS's, SCO OpenServer 5.0.X, SCO UnixWare 7.1.4, and OpenServer 6.0.X to build and run git.

        Developer's Certificate of Origin 1.1
        By making a contribution to this project, I certify that:
        (a) The contribution was created in whole or in part by me and I
            have the right to submit it under the open source license
            indicated in the file; or
        (b) The contribution is based upon previous work that, to the best
            of my knowledge, is covered under an appropriate open source
            license and I have the right under that license to submit that
            work with modifications, whether created in whole or in part
            by me, under the same open source license (unless I am
            permitted to submit under a different license), as indicated
            in the file; or
        (c) The contribution was provided directly to me by some other
            person who certified (a), (b) or (c) and I have not modified
            it.
	(d) I understand and agree that this project and the contribution
	    are public and that a record of the contribution (including all
	    personal information I submit with it, including my sign-off) is
	    maintained indefinitely and may be redistributed consistent with
	    this project or the open source license(s) involved.
Signed-off-by: Boyd Lynn Gerber <gerberb@zenez.com>

-- Boyd Gerber <gerberb@zenez.com> ZENEZ 1042 East Fort Union #135, Midvale Utah 84047

Show changes to 3 files +62 −3

Makefile, git-compat-util.h, progress.c

diff --git a/Makefile b/Makefile
index cce5a6e..6df008a 100644
--- a/Makefile
+++ b/Makefile
@@ -165,6 +165,20 @@ uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
 # CFLAGS and LDFLAGS are for the users to override from the command line.
 
 CFLAGS = -g -O2 -Wall
+ifeq ($(uname_S),SCO_SV)
+  ifeq ($(uname_R),3.2)
+#    CFLAGS = -g -O2
+    CFLAGS = -g
+  endif
+  ifeq ($(uname_R),5)
+    CFLAGS = -g -O2 -Wall
+#    CFLAGS = -g -O2
+  endif
+endif
+ifeq ($(uname_S),UnixWare)
+    CFLAGS = -g -O2 -Wall
+#    CFLAGS = -g -O2
+endif
 LDFLAGS =
 ALL_CFLAGS = $(CFLAGS)
 ALL_LDFLAGS = $(LDFLAGS)
@@ -207,7 +221,8 @@ GITWEB_SITE_FOOTER =
 
 export prefix bindir gitexecdir sharedir template_dir htmldir sysconfdir
 
-CC = gcc
+#CC = gcc
+CC = "cc"
 AR = ar
 RM = rm -f
 TAR = tar
@@ -564,6 +579,42 @@ endif
 ifeq ($(uname_S),GNU/kFreeBSD)
 	NO_STRLCPY = YesPlease
 endif
+ifeq ($(uname_S),UnixWare)
+	NEEDS_SOCKET = YesPlease
+#	NEEDS_NSL = YesPlease
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	SHELL_PATH = /usr/local/bin/bash
+	NO_IPV6 = YesPlease
+	NO_HSTRERROR = YesPlease
+#	BASIC_CFLAGS +=  -E -H
+	BASIC_CFLAGS +=  -Kalloca -Kthread
+	BASIC_CFLAGS += -I/usr/local/include
+	BASIC_LDFLAGS += -L/usr/local/lib
+	INSTALL = ginstall
+	TAR = gtar
+	NO_STRCASESTR = YesPlease
+	NO_MEMMEM = YesPlease
+endif
+ifeq ($(uname_S),SCO_SV)
+	NEEDS_SOCKET = YesPlease
+#	NEEDS_NSL = YesPlease
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	SHELL_PATH = /usr/bin/bash
+	NO_IPV6 = YesPlease
+#	NO_HSTRERROR = YesPlease
+#	BASIC_CFLAGS +=  -E -H
+      ifeq ($(uname_R),5)
+	BASIC_CFLAGS +=  -Kalloca -Kthread
+      endif
+#	BASIC_CFLAGS += -I/usr/local/include
+#	BASIC_LDFLAGS += -L/usr/local/lib
+	NO_STRCASESTR = YesPlease
+	NO_MEMMEM = YesPlease
+	INSTALL = ginstall
+	TAR = gtar
+endif
 ifeq ($(uname_S),Darwin)
 	NEEDS_SSL_WITH_CRYPTO = YesPlease
 	NEEDS_LIBICONV = YesPlease
diff --git a/git-compat-util.h b/git-compat-util.h
index 01c4045..b57041c 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -39,7 +39,7 @@
 /* Approximation of the length of the decimal representation of this type. */
 #define decimal_length(x)	((int)(sizeof(x) * 2.56 + 0.5) + 1)
 
-#if !defined(__APPLE__) && !defined(__FreeBSD__)
+#if !defined(__APPLE__) && !defined(__FreeBSD__ ) && !defined(__USLC__) && !defined(_M_UNIX)
 #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
 #endif
@@ -89,6 +89,10 @@
 #include <grp.h>
 #define _ALL_SOURCE 1
 #endif
+#if defined(__USLC__)
+#undef _XOPEN_SOURCE
+#include <grp.h>
+#endif
 
 #ifndef NO_ICONV
 #include <iconv.h>
@@ -206,12 +210,15 @@ void *gitmemmem(const void *haystack, size_t haystacklen,
 #endif
 
 #ifdef FREAD_READS_DIRECTORIES
+#if !defined (__USLC__)
 #ifdef fopen
 #undef fopen
 #endif
 #define fopen(a,b) git_fopen(a,b)
 extern FILE *git_fopen(const char*, const char*);
 #endif
+#endif
+#endif
 
 #ifdef SNPRINTF_RETURNS_BOGUS
 #define snprintf git_snprintf
diff --git a/progress.c b/progress.c
index d19f80c..11a0841 100644
--- a/progress.c
+++ b/progress.c
@@ -241,7 +241,8 @@ void stop_progress_msg(struct progress **p_progress, const char *msg)
 	*p_progress = NULL;
 	if (progress->last_value != -1) {
 		/* Force the last update */
-		char buf[strlen(msg) + 5];
+		/* char buf[strlen(msg) + 5]; */
+		char *buf = malloc (strlen(msg) + 5 );
 		struct throughput *tp = progress->throughput;
 		if (tp) {
 			unsigned int rate = !tp->avg_misecs ? 0 :
-- 
1.5.2.4
Jeremy Maitin-Shepard· Jun 6, 2008, 19:39 UTC · re: Boyd Lynn Gerber · lore

Re: [PATCH] This patch is to allow 12 different OS's to compile and run git.

Boyd Lynn Gerber <gerberb@zenez.com> writes:
[snip]
Show 12 quoted lines
> diff --git a/progress.c b/progress.c
> index d19f80c..11a0841 100644
> --- a/progress.c
> +++ b/progress.c
> @@ -241,7 +241,8 @@ void stop_progress_msg(struct progress **p_progress, const
> char *msg)
>  	*p_progress = NULL;
>  	if (progress->last_value != -1) {
>  		/* Force the last update */
> -		char buf[strlen(msg) + 5];
> +		/* char buf[strlen(msg) + 5]; */
> +		char *buf = malloc (strlen(msg) + 5 );

This change will result in the allocated memory being leaked, which is probably not correct. Perhaps change it to alloca instead.

-- 
Jeremy Maitin-Shepard
Boyd Lynn Gerber· Jun 6, 2008, 20:02 UTC · re: Jeremy Maitin-Shepard · lore

Re: [PATCH] This patch is to allow 12 different OS's to compile and run git.

On Fri, 6 Jun 2008, Jeremy Maitin-Shepard wrote:
> This change will result in the allocated memory being leaked, which is
> probably not correct.  Perhaps change it to alloca instead.
OK below is a new version with the suggestions.

-- Boyd Gerber <gerberb@zenez.com> ZENEZ 1042 East Fort Union #135, Midvale Utah 84047

---------------------------------New-Submittal-------------------------
From 554045d534dfa89f01fc6b0a819c73ad660f02fb Fri Jun  6 14:01:55 MDT 2008
From: Boyd Lynn Gerber <gerberb@zenez.com>
Date: Fri, 6 Jun 2008 13:58:04 -0600
Subject: [PATCH] This patch is to allow 12 different OS's to compile and run git.
This patch has patches to

Makefile git-compat-util.h progress.c

This patch allows some older OS's, SCO OpenServer 5.0.X, SCO UnixWare 7.1.4, and OpenServer 6.0.X to build and run git.

        Developer's Certificate of Origin 1.1
        By making a contribution to this project, I certify that:
        (a) The contribution was created in whole or in part by me and I
            have the right to submit it under the open source license
            indicated in the file; or
        (b) The contribution is based upon previous work that, to the best
            of my knowledge, is covered under an appropriate open source
            license and I have the right under that license to submit that
            work with modifications, whether created in whole or in part
            by me, under the same open source license (unless I am
            permitted to submit under a different license), as indicated
            in the file; or
        (c) The contribution was provided directly to me by some other
            person who certified (a), (b) or (c) and I have not modified
            it.
        (d) I understand and agree that this project and the contribution
            are public and that a record of the contribution (including all
            personal information I submit with it, including my sign-off) is
            maintained indefinitely and may be redistributed consistent with
            this project or the open source license(s) involved.
Signed-off-by: Boyd Lynn Gerber <gerberb@zenez.com>

-- Boyd Gerber <gerberb@zenez.com> ZENEZ 1042 East Fort Union #135, Midvale Utah 84047

Show changes to 3 files +56 −3

Makefile, git-compat-util.h, progress.c

diff --git a/Makefile b/Makefile
index cce5a6e..6df008a 100644
--- a/Makefile
+++ b/Makefile
@@ -165,6 +165,20 @@ uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
 # CFLAGS and LDFLAGS are for the users to override from the command line.
 
 CFLAGS = -g -O2 -Wall
+ifeq ($(uname_S),SCO_SV)
+  ifeq ($(uname_R),3.2)
+#    CFLAGS = -g -O2
+    CFLAGS = -g
+  endif
+  ifeq ($(uname_R),5)
+    CFLAGS = -g -O2 -Wall
+#    CFLAGS = -g -O2
+  endif
+endif
+ifeq ($(uname_S),UnixWare)
+    CFLAGS = -g -O2 -Wall
+#    CFLAGS = -g -O2
+endif
 LDFLAGS =
 ALL_CFLAGS = $(CFLAGS)
 ALL_LDFLAGS = $(LDFLAGS)
@@ -207,7 +221,8 @@ GITWEB_SITE_FOOTER =
 
 export prefix bindir gitexecdir sharedir template_dir htmldir sysconfdir
 
-CC = gcc
+#CC = gcc
+CC = "cc"
 AR = ar
 RM = rm -f
 TAR = tar
@@ -564,6 +579,42 @@ endif
 ifeq ($(uname_S),GNU/kFreeBSD)
 	NO_STRLCPY = YesPlease
 endif
+ifeq ($(uname_S),UnixWare)
+	NEEDS_SOCKET = YesPlease
+#	NEEDS_NSL = YesPlease
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	SHELL_PATH = /usr/local/bin/bash
+	NO_IPV6 = YesPlease
+	NO_HSTRERROR = YesPlease
+#	BASIC_CFLAGS +=  -E -H
+	BASIC_CFLAGS +=  -Kalloca -Kthread
+	BASIC_CFLAGS += -I/usr/local/include
+	BASIC_LDFLAGS += -L/usr/local/lib
+	INSTALL = ginstall
+	TAR = gtar
+	NO_STRCASESTR = YesPlease
+	NO_MEMMEM = YesPlease
+endif
+ifeq ($(uname_S),SCO_SV)
+	NEEDS_SOCKET = YesPlease
+#	NEEDS_NSL = YesPlease
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	SHELL_PATH = /usr/bin/bash
+	NO_IPV6 = YesPlease
+#	NO_HSTRERROR = YesPlease
+#	BASIC_CFLAGS +=  -E -H
+      ifeq ($(uname_R),5)
+	BASIC_CFLAGS +=  -Kalloca -Kthread
+      endif
+#	BASIC_CFLAGS += -I/usr/local/include
+#	BASIC_LDFLAGS += -L/usr/local/lib
+	NO_STRCASESTR = YesPlease
+	NO_MEMMEM = YesPlease
+	INSTALL = ginstall
+	TAR = gtar
+endif
 ifeq ($(uname_S),Darwin)
 	NEEDS_SSL_WITH_CRYPTO = YesPlease
 	NEEDS_LIBICONV = YesPlease
diff --git a/git-compat-util.h b/git-compat-util.h
index 01c4045..f27aea3 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -39,7 +39,8 @@
 /* Approximation of the length of the decimal representation of this type. */
 #define decimal_length(x)	((int)(sizeof(x) * 2.56 + 0.5) + 1)
 
-#if !defined(__APPLE__) && !defined(__FreeBSD__)
+#if !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !de
+fined(_M_UNIX)
 #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
 #endif
diff --git a/progress.c b/progress.c
index d19f80c..295c4e3 100644
--- a/progress.c
+++ b/progress.c
@@ -241,7 +241,8 @@ void stop_progress_msg(struct progress **p_progress, const char *msg)
 	*p_progress = NULL;
 	if (progress->last_value != -1) {
 		/* Force the last update */
-		char buf[strlen(msg) + 5];
+		/* char buf[strlen(msg) + 5]; */
+		char *buf = alloca (strlen(msg) + 5 );
 		struct throughput *tp = progress->throughput;
 		if (tp) {
 			unsigned int rate = !tp->avg_misecs ? 0 :
-- 
1.5.2.4
Stephan Beyer· Jun 6, 2008, 20:15 UTC · re: Boyd Lynn Gerber · lore

Re: [PATCH] This patch is to allow 12 different OS's to compile and run git.

Hi,
>         Developer's Certificate of Origin 1.1

It's not necessary, or even unwanted, to copy&paste this into the commit message.

The Signed-off-by: line
> Signed-off-by: Boyd Lynn Gerber <gerberb@zenez.com>

is enough. So just use the Signed-off-by line and not the whole DCO.

As Documentation/SubmittingPatches says: ---- The sign-off is a simple line at the end of the explanation for the patch[...]. [...] if you can certify the below:

        Developer's Certificate of Origin 1.1
	[...]
then you just add a line saying
        Signed-off-by: Random J Developer <random@developer.example.org>
----
Regards,
  Stephan
-- 
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F
Linus Torvalds· Jun 6, 2008, 20:28 UTC · re: Stephan Beyer · lore

Re: [PATCH] This patch is to allow 12 different OS's to compile and run git.

On Fri, 6 Jun 2008, Stephan Beyer wrote:
>
> It's not necessary, or even unwanted, to copy&paste this into the
> commit message.

Considering the particular OS's it adds support for and Boyd's geographical location, I suspect Boyd is pretty used to by now having to make _very_ clear to people that he understands the GPL and has the right to post the changes.

Sometimes a little bit of extra clarity is a good thing.
			Linus
Boyd Lynn Gerber· Jun 6, 2008, 20:44 UTC · re: Linus Torvalds · lore

Re: [PATCH] This patch is to allow 12 different OS's to compile and run git.

On Fri, 6 Jun 2008, Linus Torvalds wrote:
Show 11 quoted lines
> On Fri, 6 Jun 2008, Stephan Beyer wrote:
> >
> > It's not necessary, or even unwanted, to copy&paste this into the 
> > commit message.
> 
> Considering the particular OS's it adds support for and Boyd's 
> geographical location, I suspect Boyd is pretty used to by now having to 
> make _very_ clear to people that he understands the GPL and has the 
> right to post the changes.
> 
> Sometimes a little bit of extra clarity is a good thing.

You hit the nail on the head. I get tired of doing exactly that. Just south of me 20-40 miles is the location of SCO Lindon, Utah. I have to make it really clear in most things I do that I understand and totally support the GPL. I have done work for said group and always add in my contracts that what is being done has to support the GPL and strict compliance is necessary. All changes will be sent upstream for inclusion at the project head. Whether they are added or not is really not the issue. I want any and all changes to follow what ever licence they are under and everything has to be in compliance with the licences.

Thanks,

-- Boyd Gerber <gerberb@zenez.com> ZENEZ 1042 East Fort Union #135, Midvale Utah 84047

Brandon Casey· Jun 6, 2008, 22:16 UTC · re: Boyd Lynn Gerber · lore

Re: [PATCH] This patch is to allow 12 different OS's to compile and run git.

Boyd Lynn Gerber wrote:
Show 5 quoted lines
> On Fri, 6 Jun 2008, Jeremy Maitin-Shepard wrote:
>> This change will result in the allocated memory being leaked, which is
>> probably not correct.  Perhaps change it to alloca instead.
> 
> OK below is a new version with the suggestions.
Comments below basically amount to:
  1) Use tab when indenting.
  2) Remove commented-out dead code
  3) Don't put space between function name and open parenthesis.
Show 10 quoted lines
> diff --git a/Makefile b/Makefile
> index cce5a6e..6df008a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -165,6 +165,20 @@ uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
>  # CFLAGS and LDFLAGS are for the users to override from the command line.
>  
>  CFLAGS = -g -O2 -Wall
> +ifeq ($(uname_S),SCO_SV)
> +  ifeq ($(uname_R),3.2)
Indent with a tab not 2 spaces.
> +#    CFLAGS = -g -O2
These commented out assignments should not be included in the final patch.
> +    CFLAGS = -g
Use tab.
> +  endif
> +  ifeq ($(uname_R),5)
> +    CFLAGS = -g -O2 -Wall
> +#    CFLAGS = -g -O2
ditto on comment and tab.
Show 5 quoted lines
> +  endif
> +endif
> +ifeq ($(uname_S),UnixWare)
> +    CFLAGS = -g -O2 -Wall
> +#    CFLAGS = -g -O2
ditto
Show 11 quoted lines
> +endif
>  LDFLAGS =
>  ALL_CFLAGS = $(CFLAGS)
>  ALL_LDFLAGS = $(LDFLAGS)
> @@ -207,7 +221,8 @@ GITWEB_SITE_FOOTER =
>  
>  export prefix bindir gitexecdir sharedir template_dir htmldir sysconfdir
>  
> -CC = gcc
> +#CC = gcc
> +CC = "cc"

This one is up to Junio. Perhaps he has some reason for specifically configuring gcc. In which case this CC selection maybe should go in the UnixWare section.

Show 10 quoted lines
>  AR = ar
>  RM = rm -f
>  TAR = tar
> @@ -564,6 +579,42 @@ endif
>  ifeq ($(uname_S),GNU/kFreeBSD)
>  	NO_STRLCPY = YesPlease
>  endif
> +ifeq ($(uname_S),UnixWare)
> +	NEEDS_SOCKET = YesPlease
> +#	NEEDS_NSL = YesPlease
Commented out. Why is it in the patch?
Show 6 quoted lines
> +	NEEDS_SSL_WITH_CRYPTO = YesPlease
> +	NEEDS_LIBICONV = YesPlease
> +	SHELL_PATH = /usr/local/bin/bash
> +	NO_IPV6 = YesPlease
> +	NO_HSTRERROR = YesPlease
> +#	BASIC_CFLAGS +=  -E -H
ummhmm.
Show 11 quoted lines
> +	BASIC_CFLAGS +=  -Kalloca -Kthread
> +	BASIC_CFLAGS += -I/usr/local/include
> +	BASIC_LDFLAGS += -L/usr/local/lib
> +	INSTALL = ginstall
> +	TAR = gtar
> +	NO_STRCASESTR = YesPlease
> +	NO_MEMMEM = YesPlease
> +endif
> +ifeq ($(uname_S),SCO_SV)
> +	NEEDS_SOCKET = YesPlease
> +#	NEEDS_NSL = YesPlease
Show 6 quoted lines
> +	NEEDS_SSL_WITH_CRYPTO = YesPlease
> +	NEEDS_LIBICONV = YesPlease
> +	SHELL_PATH = /usr/bin/bash
> +	NO_IPV6 = YesPlease
> +#	NO_HSTRERROR = YesPlease
> +#	BASIC_CFLAGS +=  -E -H
> +      ifeq ($(uname_R),5)
tabs
> +	BASIC_CFLAGS +=  -Kalloca -Kthread
> +      endif
tab.
> +#	BASIC_CFLAGS += -I/usr/local/include
> +#	BASIC_LDFLAGS += -L/usr/local/lib
Show 32 quoted lines
> +	NO_STRCASESTR = YesPlease
> +	NO_MEMMEM = YesPlease
> +	INSTALL = ginstall
> +	TAR = gtar
> +endif
>  ifeq ($(uname_S),Darwin)
>  	NEEDS_SSL_WITH_CRYPTO = YesPlease
>  	NEEDS_LIBICONV = YesPlease
> diff --git a/git-compat-util.h b/git-compat-util.h
> index 01c4045..f27aea3 100644
> --- a/git-compat-util.h
> +++ b/git-compat-util.h
> @@ -39,7 +39,8 @@
>  /* Approximation of the length of the decimal representation of this type. */
>  #define decimal_length(x)	((int)(sizeof(x) * 2.56 + 0.5) + 1)
>  
> -#if !defined(__APPLE__) && !defined(__FreeBSD__)
> +#if !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !de
> +fined(_M_UNIX)
>  #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
>  #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
>  #endif
> diff --git a/progress.c b/progress.c
> index d19f80c..295c4e3 100644
> --- a/progress.c
> +++ b/progress.c
> @@ -241,7 +241,8 @@ void stop_progress_msg(struct progress **p_progress, const char *msg)
>  	*p_progress = NULL;
>  	if (progress->last_value != -1) {
>  		/* Force the last update */
> -		char buf[strlen(msg) + 5];
> +		/* char buf[strlen(msg) + 5]; */
       This should just be deleted.
> +		char *buf = alloca (strlen(msg) + 5 );
                                  ^
       we don't put spaces between function name and open parens.
-brandon
Junio C Hamano· Jun 6, 2008, 23:08 UTC · re: Boyd Lynn Gerber · lore

Re: [PATCH] This patch is to allow 12 different OS's to compile and run git.

Boyd Lynn Gerber <gerberb@zenez.com> writes:
Show 14 quoted lines
> diff --git a/progress.c b/progress.c
> index d19f80c..295c4e3 100644
> --- a/progress.c
> +++ b/progress.c
> @@ -241,7 +241,8 @@ void stop_progress_msg(struct progress **p_progress, const char *msg)
>  	*p_progress = NULL;
>  	if (progress->last_value != -1) {
>  		/* Force the last update */
> -		char buf[strlen(msg) + 5];
> +		/* char buf[strlen(msg) + 5]; */
> +		char *buf = alloca (strlen(msg) + 5 );
>  		struct throughput *tp = progress->throughput;
>  		if (tp) {
>  			unsigned int rate = !tp->avg_misecs ? 0 :

I do not know the situation over there these days, but I have a distant but bitter memory of having to deal with AIX X-<. It insisted that inclusion of <alloca.h> to be the very first thing in the source before anything else. I would want to keep alloca() out of the codebase without very good reason. Not that I care much about portability to AIX, but not having to worry about alloca() unless necessary is a good thing.

I do not think progress_msg() is a good reason to even worrying about a dynamically sized array. The function is designed to spit out a single line of message (so the incoming msg is expected to be shorter than 80 chars or so). If you "git grep stop_progress_msg", you will see that there are only two callers of this function, one in progress.c itself that says "done", and the other one in index-pack.c that gives a string formatted into 48-byte buffer.

So we can be lazy and say:
	char buf[128];
        ...
        snprintf(buf, sizeof(buf), ", %s.\n", msg)
and be done with it.

If you really wanted to be safe and anal, you could do something like this, which would be just as efficient and much more straightforward:

 progress.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
Show changes to progress.c +8 −3
diff --git a/progress.c b/progress.c
index d19f80c..55a8687 100644
--- a/progress.c
+++ b/progress.c
@@ -241,16 +241,21 @@ void stop_progress_msg(struct progress **p_progress, const char *msg)
 	*p_progress = NULL;
 	if (progress->last_value != -1) {
 		/* Force the last update */
-		char buf[strlen(msg) + 5];
+		char buf[128], *bufp;
+		size_t len = strlen(msg) + 5;
 		struct throughput *tp = progress->throughput;
+
+		bufp = (len < sizeof(buf)) ? buf : xmalloc(len + 1);
 		if (tp) {
 			unsigned int rate = !tp->avg_misecs ? 0 :
 					tp->avg_bytes / tp->avg_misecs;
 			throughput_string(tp, tp->curr_total, rate);
 		}
 		progress_update = 1;
-		sprintf(buf, ", %s.\n", msg);
-		display(progress, progress->last_value, buf);
+		sprintf(bufp, ", %s.\n", msg);
+		display(progress, progress->last_value, bufp);
+		if (buf != bufp)
+			free(bufp);
 	}
 	clear_progress_signal();
 	free(progress->throughput);
Boyd Lynn Gerber· Jun 6, 2008, 23:23 UTC · re: Junio C Hamano · lore

Re: [PATCH] This patch is to allow 12 different OS's to compile and run git.

On Fri, 6 Jun 2008, Junio C Hamano wrote:
Show 22 quoted lines
> Boyd Lynn Gerber <gerberb@zenez.com> writes:
> > diff --git a/progress.c b/progress.c
> > index d19f80c..295c4e3 100644
> > --- a/progress.c
> > +++ b/progress.c
> > @@ -241,7 +241,8 @@ void stop_progress_msg(struct progress **p_progress, const char *msg)
> >  	*p_progress = NULL;
> >  	if (progress->last_value != -1) {
> >  		/* Force the last update */
> > -		char buf[strlen(msg) + 5];
> > +		/* char buf[strlen(msg) + 5]; */
> > +		char *buf = alloca (strlen(msg) + 5 );
> >  		struct throughput *tp = progress->throughput;
> >  		if (tp) {
> >  			unsigned int rate = !tp->avg_misecs ? 0 :
> 
> I do not know the situation over there these days, but I have a distant
> but bitter memory of having to deal with AIX X-<.  It insisted that
> inclusion of <alloca.h> to be the very first thing in the source before
> anything else.  I would want to keep alloca() out of the codebase without
> very good reason.  Not that I care much about portability to AIX, but not
> having to worry about alloca() unless necessary is a good thing.
You hit the nail on the head, AIX and any Novell derived Compiler code 
requires it.  Also the SCO OS's
 
Show 15 quoted lines
> I do not think progress_msg() is a good reason to even worrying about a
> dynamically sized array.  The function is designed to spit out a single
> line of message (so the incoming msg is expected to be shorter than 80
> chars or so).  If you "git grep stop_progress_msg", you will see that
> there are only two callers of this function, one in progress.c itself that
> says "done", and the other one in index-pack.c that gives a string
> formatted into 48-byte buffer.
> 
> So we can be lazy and say:
> 
> 	char buf[128];
>         ...
>         snprintf(buf, sizeof(buf), ", %s.\n", msg)
> 
> and be done with it.
I like the idea.
Show 37 quoted lines
> If you really wanted to be safe and anal, you could do something like
> this, which would be just as efficient and much more straightforward:
> 
>  progress.c |   11 ++++++++---
>  1 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/progress.c b/progress.c
> index d19f80c..55a8687 100644
> --- a/progress.c
> +++ b/progress.c
> @@ -241,16 +241,21 @@ void stop_progress_msg(struct progress **p_progress, const char *msg)
>  	*p_progress = NULL;
>  	if (progress->last_value != -1) {
>  		/* Force the last update */
> -		char buf[strlen(msg) + 5];
> +		char buf[128], *bufp;
> +		size_t len = strlen(msg) + 5;
>  		struct throughput *tp = progress->throughput;
> +
> +		bufp = (len < sizeof(buf)) ? buf : xmalloc(len + 1);
>  		if (tp) {
>  			unsigned int rate = !tp->avg_misecs ? 0 :
>  					tp->avg_bytes / tp->avg_misecs;
>  			throughput_string(tp, tp->curr_total, rate);
>  		}
>  		progress_update = 1;
> -		sprintf(buf, ", %s.\n", msg);
> -		display(progress, progress->last_value, buf);
> +		sprintf(bufp, ", %s.\n", msg);
> +		display(progress, progress->last_value, bufp);
> +		if (buf != bufp)
> +			free(bufp);
>  	}
>  	clear_progress_signal();
>  	free(progress->throughput);
> 
> 

Thanks for the suggestions. I am making changes based on all the feed back. I will remove all the debug junk from the final patch. I am putting options in and out a lot at the moment. Trying to make sure I do not break anything on the 12 OS's. It is a real pain testing all the changes on them to make sure I did not break anything.

Thanks,

-- Boyd Gerber <gerberb@zenez.com> ZENEZ 1042 East Fort Union #135, Midvale Utah 84047

Boyd Lynn Gerber· Jun 7, 2008, 00:38 UTC · re: Boyd Lynn Gerber · lore

Re: [PATCH] 0002 This patch is to allow 12 different OS's to compile and run git.

>From db0574a7f89bb90b6ce02cd44053f8cec2c454cc
This patch has patches to

Makefile git-compat-util.h progress.c

This patch allows some older OS's, SCO OpenServer 5.0.X, SCO UnixWare 7.1.4, and OpenServer 6.0.X to build and run git. Applied suggestions from list.

        Developer's Certificate of Origin 1.1
        By making a contribution to this project, I certify that:
        (a) The contribution was created in whole or in part by me and I
            have the right to submit it under the open source license
            indicated in the file; or
        (b) The contribution is based upon previous work that, to the best
            of my knowledge, is covered under an appropriate open source
            license and I have the right under that license to submit that
            work with modifications, whether created in whole or in part
            by me, under the same open source license (unless I am
            permitted to submit under a different license), as indicated
            in the file; or
        (c) The contribution was provided directly to me by some other
            person who certified (a), (b) or (c) and I have not modified
            it.
        (d) I understand and agree that this project and the contribution
            are public and that a record of the contribution (including all
            personal information I submit with it, including my sign-off) is
            maintained indefinitely and may be redistributed consistent with
            this project or the open source license(s) involved.
Signed-off-by: Boyd Lynn Gerber <gerberb@zenez.com>

-- Boyd Gerber <gerberb@zenez.com> ZENEZ 1042 East Fort Union #135, Midvale Utah 84047

Show changes to 3 files +72 −4

Makefile, git-compat-util.h, progress.c

diff --git a/Makefile b/Makefile
index cce5a6e..a0456c8 100644
--- a/Makefile
+++ b/Makefile
@@ -165,6 +165,28 @@ uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
 # CFLAGS and LDFLAGS are for the users to override from the command line.
 
 CFLAGS = -g -O2 -Wall
+ifeq ($(uname_S),SCO_SV)
+	ifeq ($(uname_R),3.2)
+#	Change to -O2 for released version
+#	CFLAGS = -O2
+#	Debug Version
+		CFLAGS = -g
+	endif
+#	For System V based OS's
+	ifeq ($(uname_R),5)
+#	For System V based OS's and shared libraries
+		CFLAGS = -g -O2 -Wall
+#	Use for Static version
+#		CFLAGS = -g -O2
+	endif
+endif
+#	For all UnixWare Versions.
+ifeq ($(uname_S),UnixWare)
+#	For System V based OS's and shared libraries
+	CFLAGS = -g -O2 -Wall
+#	Use for Static version
+#	CFLAGS = -g -O2
+endif
 LDFLAGS =
 ALL_CFLAGS = $(CFLAGS)
 ALL_LDFLAGS = $(LDFLAGS)
@@ -564,6 +586,42 @@ endif
 ifeq ($(uname_S),GNU/kFreeBSD)
 	NO_STRLCPY = YesPlease
 endif
+ifeq ($(uname_S),UnixWare)
+	CC=cc
+	NEEDS_SOCKET = YesPlease
+	NEEDS_NSL = YesPlease
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	SHELL_PATH = /usr/local/bin/bash
+	NO_IPV6 = YesPlease
+	NO_HSTRERROR = YesPlease
+	BASIC_CFLAGS +=  -Kalloca -Kthread
+	BASIC_CFLAGS += -I/usr/local/include
+	BASIC_LDFLAGS += -L/usr/local/lib
+	INSTALL = ginstall
+	TAR = gtar
+	NO_STRCASESTR = YesPlease
+	NO_MEMMEM = YesPlease
+endif
+ifeq ($(uname_S),SCO_SV)
+	NEEDS_SOCKET = YesPlease
+	NEEDS_NSL = YesPlease
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	SHELL_PATH = /usr/bin/bash
+	NO_IPV6 = YesPlease
+	NO_HSTRERROR = YesPlease
+	ifeq ($(uname_R),5)
+		CC=cc
+		BASIC_CFLAGS +=  -Kalloca -Kthread
+	endif
+	BASIC_CFLAGS += -I/usr/local/include
+	BASIC_LDFLAGS += -L/usr/local/lib
+	NO_STRCASESTR = YesPlease
+	NO_MEMMEM = YesPlease
+	INSTALL = ginstall
+	TAR = gtar
+endif
 ifeq ($(uname_S),Darwin)
 	NEEDS_SSL_WITH_CRYPTO = YesPlease
 	NEEDS_LIBICONV = YesPlease
diff --git a/git-compat-util.h b/git-compat-util.h
index 01c4045..b3cd7b3 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -39,7 +39,12 @@
 /* Approximation of the length of the decimal representation of this type. */
 #define decimal_length(x)	((int)(sizeof(x) * 2.56 + 0.5) + 1)
 
-#if !defined(__APPLE__) && !defined(__FreeBSD__)
+/* Added for __USLC__ for any Novell devrived Compiler and Some Sys V 
+   Added _M_UNIX for any XENIX/SCO UNIX/OpenServer less than or equal
+   OpenServer 5.0.7  This is do avoided compiler hell like the other
+   OS's __APPLE__ and __FreeBSD__ */
+#if !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !de
+fined(_M_UNIX)
 #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
 #endif
diff --git a/progress.c b/progress.c
index d19f80c..55a8687 100644
--- a/progress.c
+++ b/progress.c
@@ -241,16 +241,21 @@ void stop_progress_msg(struct progress **p_progress, const char *msg)
 	*p_progress = NULL;
 	if (progress->last_value != -1) {
 		/* Force the last update */
-		char buf[strlen(msg) + 5];
+		char buf[128], *bufp;
+		size_t len = strlen(msg) + 5;
 		struct throughput *tp = progress->throughput;
+
+		bufp = (len < sizeof(buf)) ? buf : xmalloc(len + 1);
 		if (tp) {
 			unsigned int rate = !tp->avg_misecs ? 0 :
 					tp->avg_bytes / tp->avg_misecs;
 			throughput_string(tp, tp->curr_total, rate);
 		}
 		progress_update = 1;
-		sprintf(buf, ", %s.\n", msg);
-		display(progress, progress->last_value, buf);
+		sprintf(bufp, ", %s.\n", msg);
+		display(progress, progress->last_value, bufp);
+		if (buf != bufp)
+			free(bufp);
 	}
 	clear_progress_signal();
 	free(progress->throughput);
-- 
1.5.2.4
Daniel Barkalow· Jun 7, 2008, 00:47 UTC · re: Boyd Lynn Gerber · lore

Re: [PATCH] 0002 This patch is to allow 12 different OS's to compile and run git.

On Fri, 6 Jun 2008, Boyd Lynn Gerber wrote:
Show 62 quoted lines
> From db0574a7f89bb90b6ce02cd44053f8cec2c454cc
> 
> This patch has patches to
> 
> Makefile
> git-compat-util.h
> progress.c
> 
> This patch allows some older OS's, SCO OpenServer 5.0.X, SCO UnixWare 7.1.4,
> and OpenServer 6.0.X to build and run git.  Applied suggestions from list.
> 
>         Developer's Certificate of Origin 1.1
> 
>         By making a contribution to this project, I certify that:
> 
>         (a) The contribution was created in whole or in part by me and I
>             have the right to submit it under the open source license
>             indicated in the file; or
> 
>         (b) The contribution is based upon previous work that, to the best
>             of my knowledge, is covered under an appropriate open source
>             license and I have the right under that license to submit that
>             work with modifications, whether created in whole or in part
>             by me, under the same open source license (unless I am
>             permitted to submit under a different license), as indicated
>             in the file; or
> 
>         (c) The contribution was provided directly to me by some other
>             person who certified (a), (b) or (c) and I have not modified
>             it.
> 
>         (d) I understand and agree that this project and the contribution
>             are public and that a record of the contribution (including all
>             personal information I submit with it, including my sign-off) is
>             maintained indefinitely and may be redistributed consistent with
>             this project or the open source license(s) involved.
> 
> Signed-off-by: Boyd Lynn Gerber <gerberb@zenez.com>
> 
> --
> Boyd Gerber <gerberb@zenez.com>
> ZENEZ   1042 East Fort Union #135, Midvale Utah  84047
> 
> diff --git a/Makefile b/Makefile
> index cce5a6e..a0456c8 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -165,6 +165,28 @@ uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
>  # CFLAGS and LDFLAGS are for the users to override from the command line.
>  
>  CFLAGS = -g -O2 -Wall
> +ifeq ($(uname_S),SCO_SV)
> +	ifeq ($(uname_R),3.2)
> +#	Change to -O2 for released version
> +#	CFLAGS = -O2
> +#	Debug Version
> +		CFLAGS = -g
> +	endif
> +#	For System V based OS's
> +	ifeq ($(uname_R),5)
> +#	For System V based OS's and shared libraries
> +		CFLAGS = -g -O2 -Wall

You don't need this, because CFLAGS is already -g -O2 -Wall, since we set it above and couldn't have changed it.

> +#	Use for Static version
> +#		CFLAGS = -g -O2
Static libraries don't support -Wall?
Show 6 quoted lines
> +	endif
> +endif
> +#	For all UnixWare Versions.
> +ifeq ($(uname_S),UnixWare)
> +#	For System V based OS's and shared libraries
> +	CFLAGS = -g -O2 -Wall
Again, this just sets it to what it must already be.

You might want to test something the person doing the build can put somewhere, rather than commenting out the lines you're not using.

	-Daniel
*This .sig left intentionally blank*
Boyd Lynn Gerber· Jun 7, 2008, 01:25 UTC · re: Daniel Barkalow · lore

Re: [PATCH] 0003 This patch is to allow 12 different OS's to compile and run git.

On Fri, 6 Jun 2008, Daniel Barkalow wrote:
Show 44 quoted lines
> On Fri, 6 Jun 2008, Boyd Lynn Gerber wrote:
> 
> > From db0574a7f89bb90b6ce02cd44053f8cec2c454cc
> > 
> > This patch has patches to
> > 
> > Makefile
> > git-compat-util.h
> > progress.c
> > 
> > This patch allows some older OS's, SCO OpenServer 5.0.X, SCO UnixWare 7.1.4,
> > and OpenServer 6.0.X to build and run git.  Applied suggestions from list.
> > 
> >         Developer's Certificate of Origin 1.1
> > 
> >         By making a contribution to this project, I certify that:
> > 
> >         (a) The contribution was created in whole or in part by me and I
> >             have the right to submit it under the open source license
> >             indicated in the file; or
> > 
> >         (b) The contribution is based upon previous work that, to the best
> >             of my knowledge, is covered under an appropriate open source
> >             license and I have the right under that license to submit that
> >             work with modifications, whether created in whole or in part
> >             by me, under the same open source license (unless I am
> >             permitted to submit under a different license), as indicated
> >             in the file; or
> > 
> >         (c) The contribution was provided directly to me by some other
> >             person who certified (a), (b) or (c) and I have not modified
> >             it.
> > 
> >         (d) I understand and agree that this project and the contribution
> >             are public and that a record of the contribution (including all
> >             personal information I submit with it, including my sign-off) is
> >             maintained indefinitely and may be redistributed consistent with
> >             this project or the open source license(s) involved.
> > 
> > Signed-off-by: Boyd Lynn Gerber <gerberb@zenez.com>
> > 
> > --
> > Boyd Gerber <gerberb@zenez.com>
> > ZENEZ   1042 East Fort Union #135, Midvale Utah  84047
OK made changes you recommended.
Show changes to 3 files +55 −5

Makefile, git-compat-util.h, progress.c

diff --git a/Makefile b/Makefile
index cce5a6e..000bf1f 100644
--- a/Makefile
+++ b/Makefile
@@ -165,6 +165,11 @@ uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
 # CFLAGS and LDFLAGS are for the users to override from the command line.
 
 CFLAGS = -g -O2 -Wall
+ifeq ($(uname_S),SCO_SV)
+	ifeq ($(uname_R),3.2)
+		CFLAGS = -O2
+	endif
+endif
 LDFLAGS =
 ALL_CFLAGS = $(CFLAGS)
 ALL_LDFLAGS = $(LDFLAGS)
@@ -564,6 +569,42 @@ endif
 ifeq ($(uname_S),GNU/kFreeBSD)
 	NO_STRLCPY = YesPlease
 endif
+ifeq ($(uname_S),UnixWare)
+	CC=cc
+	NEEDS_SOCKET = YesPlease
+	NEEDS_NSL = YesPlease
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	SHELL_PATH = /usr/local/bin/bash
+	NO_IPV6 = YesPlease
+	NO_HSTRERROR = YesPlease
+	BASIC_CFLAGS +=  -Kalloca -Kthread
+	BASIC_CFLAGS += -I/usr/local/include
+	BASIC_LDFLAGS += -L/usr/local/lib
+	INSTALL = ginstall
+	TAR = gtar
+	NO_STRCASESTR = YesPlease
+	NO_MEMMEM = YesPlease
+endif
+ifeq ($(uname_S),SCO_SV)
+	NEEDS_SOCKET = YesPlease
+	NEEDS_NSL = YesPlease
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	SHELL_PATH = /usr/bin/bash
+	NO_IPV6 = YesPlease
+	NO_HSTRERROR = YesPlease
+	ifeq ($(uname_R),5)
+		CC=cc
+		BASIC_CFLAGS +=  -Kalloca -Kthread
+	endif
+	BASIC_CFLAGS += -I/usr/local/include
+	BASIC_LDFLAGS += -L/usr/local/lib
+	NO_STRCASESTR = YesPlease
+	NO_MEMMEM = YesPlease
+	INSTALL = ginstall
+	TAR = gtar
+endif
 ifeq ($(uname_S),Darwin)
 	NEEDS_SSL_WITH_CRYPTO = YesPlease
 	NEEDS_LIBICONV = YesPlease
diff --git a/git-compat-util.h b/git-compat-util.h
index 01c4045..b3cd7b3 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -39,7 +39,12 @@
 /* Approximation of the length of the decimal representation of this type. */
 #define decimal_length(x)	((int)(sizeof(x) * 2.56 + 0.5) + 1)
 
-#if !defined(__APPLE__) && !defined(__FreeBSD__)
+/* Added for __USLC__ for any Novell devrived Compiler and Some Sys V 
+   Added _M_UNIX for any XENIX/SCO UNIX/OpenServer less than or equal
+   OpenServer 5.0.7  This is do avoided compiler hell like the other
+   OS's __APPLE__ and __FreeBSD__ */
+#if !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !de
+fined(_M_UNIX)
 #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
 #endif
diff --git a/progress.c b/progress.c
index d19f80c..55a8687 100644
--- a/progress.c
+++ b/progress.c
@@ -241,16 +241,21 @@ void stop_progress_msg(struct progress **p_progress, const char *msg)
 	*p_progress = NULL;
 	if (progress->last_value != -1) {
 		/* Force the last update */
-		char buf[strlen(msg) + 5];
+		char buf[128], *bufp;
+		size_t len = strlen(msg) + 5;
 		struct throughput *tp = progress->throughput;
+
+		bufp = (len < sizeof(buf)) ? buf : xmalloc(len + 1);
 		if (tp) {
 			unsigned int rate = !tp->avg_misecs ? 0 :
 					tp->avg_bytes / tp->avg_misecs;
 			throughput_string(tp, tp->curr_total, rate);
 		}
 		progress_update = 1;
-		sprintf(buf, ", %s.\n", msg);
-		display(progress, progress->last_value, buf);
+		sprintf(bufp, ", %s.\n", msg);
+		display(progress, progress->last_value, bufp);
+		if (buf != bufp)
+			free(bufp);
 	}
 	clear_progress_signal();
 	free(progress->throughput);

--
Boyd Gerber <gerberb@zenez.com>
ZENEZ	1042 East Fort Union #135, Midvale Utah  84047
Junio C Hamano· Jun 7, 2008, 02:12 UTC · re: Boyd Lynn Gerber · lore

Re: [PATCH] 0003 This patch is to allow 12 different OS's to compile and run git.

Boyd Lynn Gerber <gerberb@zenez.com> writes:
Show 48 quoted lines
> On Fri, 6 Jun 2008, Daniel Barkalow wrote:
>
>> On Fri, 6 Jun 2008, Boyd Lynn Gerber wrote:
>> 
>> > From db0574a7f89bb90b6ce02cd44053f8cec2c454cc
>> > 
>> > This patch has patches to
>> > 
>> > Makefile
>> > git-compat-util.h
>> > progress.c
>> > 
>> > This patch allows some older OS's, SCO OpenServer 5.0.X, SCO UnixWare 7.1.4,
>> > and OpenServer 6.0.X to build and run git.  Applied suggestions from list.
>> > 
>> >         Developer's Certificate of Origin 1.1
>> > 
>> >         By making a contribution to this project, I certify that:
>> > 
>> >         (a) The contribution was created in whole or in part by me and I
>> >             have the right to submit it under the open source license
>> >             indicated in the file; or
>> > 
>> >         (b) The contribution is based upon previous work that, to the best
>> >             of my knowledge, is covered under an appropriate open source
>> >             license and I have the right under that license to submit that
>> >             work with modifications, whether created in whole or in part
>> >             by me, under the same open source license (unless I am
>> >             permitted to submit under a different license), as indicated
>> >             in the file; or
>> > 
>> >         (c) The contribution was provided directly to me by some other
>> >             person who certified (a), (b) or (c) and I have not modified
>> >             it.
>> > 
>> >         (d) I understand and agree that this project and the contribution
>> >             are public and that a record of the contribution (including all
>> >             personal information I submit with it, including my sign-off) is
>> >             maintained indefinitely and may be redistributed consistent with
>> >             this project or the open source license(s) involved.
>> > 
>> > Signed-off-by: Boyd Lynn Gerber <gerberb@zenez.com>
>> > 
>> > --
>> > Boyd Gerber <gerberb@zenez.com>
>> > ZENEZ   1042 East Fort Union #135, Midvale Utah  84047
>
> OK made changes you recommended.

I guess the patch text itself seems to be getting reasonable, and perhaps the next few rounds would be to fix the commit log message ;-)

Show 13 quoted lines
> diff --git a/Makefile b/Makefile
> index cce5a6e..000bf1f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -165,6 +165,11 @@ uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
>  # CFLAGS and LDFLAGS are for the users to override from the command line.
>  
>  CFLAGS = -g -O2 -Wall
> +ifeq ($(uname_S),SCO_SV)
> +	ifeq ($(uname_R),3.2)
> +		CFLAGS = -O2
> +	endif
> +endif

What makes SCO_SV so special that this platform specific tweak does not live in "Platform specific tweaks" section like others?

CFLAGS is for the user to oerride from the command line, and I do not very much like any tweaks in Makefile. I'd suggest dropping this hunk.

Show 6 quoted lines
> @@ -564,6 +569,42 @@ endif
>  ifeq ($(uname_S),GNU/kFreeBSD)
>  	NO_STRLCPY = YesPlease
>  endif
> +ifeq ($(uname_S),UnixWare)
> +	CC=cc
s/=/ = /; you have similar one elsewhere.
Show 8 quoted lines
> +	NEEDS_SOCKET = YesPlease
> +	NEEDS_NSL = YesPlease
> +	NEEDS_SSL_WITH_CRYPTO = YesPlease
> +	NEEDS_LIBICONV = YesPlease
> +	SHELL_PATH = /usr/local/bin/bash
> +	NO_IPV6 = YesPlease
> +	NO_HSTRERROR = YesPlease
> +	BASIC_CFLAGS +=  -Kalloca -Kthread

I am only guessing what -Kalloca is, but is it for alloca(3), and if so do you still need it?

Show 13 quoted lines
> diff --git a/git-compat-util.h b/git-compat-util.h
> index 01c4045..b3cd7b3 100644
> --- a/git-compat-util.h
> +++ b/git-compat-util.h
> @@ -39,7 +39,12 @@
>  /* Approximation of the length of the decimal representation of this type. */
>  #define decimal_length(x)	((int)(sizeof(x) * 2.56 + 0.5) + 1)
>  
> -#if !defined(__APPLE__) && !defined(__FreeBSD__)
> +/* Added for __USLC__ for any Novell devrived Compiler and Some Sys V 
> +   Added _M_UNIX for any XENIX/SCO UNIX/OpenServer less than or equal
> +   OpenServer 5.0.7  This is do avoided compiler hell like the other
> +   OS's __APPLE__ and __FreeBSD__ */
We generally do not do changelog inside the code comment.
> +#if !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !de
> +fined(_M_UNIX)
Linewrapped patch?  It is very curious that you have + in front of "fined(_M_UNIX)".
Boyd Lynn Gerber· Jun 7, 2008, 02:40 UTC · re: Junio C Hamano · lore

Re: [PATCH] 0003 This patch is to allow 12 different OS's to compile and run git.

On Fri, 6 Jun 2008, Junio C Hamano wrote:
> Boyd Lynn Gerber <gerberb@zenez.com> writes:
> I guess the patch text itself seems to be getting reasonable, and perhaps
> the next few rounds would be to fix the commit log message ;-)
I have it the same, without all the >> as I first posted, but I agree. 
that it needs some tweaking.
 
Show 28 quoted lines
> > diff --git a/Makefile b/Makefile
> > index cce5a6e..000bf1f 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -165,6 +165,11 @@ uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
> >  # CFLAGS and LDFLAGS are for the users to override from the command line.
> >  
> >  CFLAGS = -g -O2 -Wall
> > +ifeq ($(uname_S),SCO_SV)
> > +	ifeq ($(uname_R),3.2)
> > +		CFLAGS = -O2
> > +	endif
> > +endif
> 
> What makes SCO_SV so special that this platform specific tweak does not
> live in "Platform specific tweaks" section like others?
> 
> CFLAGS is for the user to oerride from the command line, and I do not very
> much like any tweaks in Makefile.  I'd suggest dropping this hunk.
> 
> > @@ -564,6 +569,42 @@ endif
> >  ifeq ($(uname_S),GNU/kFreeBSD)
> >  	NO_STRLCPY = YesPlease
> >  endif
> > +ifeq ($(uname_S),UnixWare)
> > +	CC=cc
> 
> s/=/ = /; you have similar one elsewhere.
I only have the one section now.  I will look at it some more.
Show 11 quoted lines
> > +	NEEDS_SOCKET = YesPlease
> > +	NEEDS_NSL = YesPlease
> > +	NEEDS_SSL_WITH_CRYPTO = YesPlease
> > +	NEEDS_LIBICONV = YesPlease
> > +	SHELL_PATH = /usr/local/bin/bash
> > +	NO_IPV6 = YesPlease
> > +	NO_HSTRERROR = YesPlease
> > +	BASIC_CFLAGS +=  -Kalloca -Kthread
> 
> I am only guessing what -Kalloca is, but is it for alloca(3), and if so do
> you still need it?

I will make tests without it on the next run. It takes about 3 hours for me to get the patches to all the system review them and then run everything. Some of the machines are really slow.

Show 15 quoted lines
> > diff --git a/git-compat-util.h b/git-compat-util.h
> > index 01c4045..b3cd7b3 100644
> > --- a/git-compat-util.h
> > +++ b/git-compat-util.h
> > @@ -39,7 +39,12 @@
> >  /* Approximation of the length of the decimal representation of this type. */
> >  #define decimal_length(x)	((int)(sizeof(x) * 2.56 + 0.5) + 1)
> >  
> > -#if !defined(__APPLE__) && !defined(__FreeBSD__)
> > +/* Added for __USLC__ for any Novell devrived Compiler and Some Sys V 
> > +   Added _M_UNIX for any XENIX/SCO UNIX/OpenServer less than or equal
> > +   OpenServer 5.0.7  This is do avoided compiler hell like the other
> > +   OS's __APPLE__ and __FreeBSD__ */
> 
> We generally do not do changelog inside the code comment.

Where do you put your change log stuff, to explain why you made the change. Maybe it is a bit left over from doing things for MySQL AB.

> > +#if !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !de
> > +fined(_M_UNIX)
> 
> Linewrapped patch?  It is very curious that you have + in front of "fined(_M_UNIX)".

It is not line wrapped in my file. I do the following after reverting every and strarting with a clean slate.

 cp -p .new/* . 
 git add Makefile git-compat-util.h progress.c
 git diff --cached
 git commit -s
 git format-patch -p -M -B origin

The last command above is creating the line wrapped because the line is so long. I do not know enough to force the tools to not do that line wrap.

-- Boyd Gerber <gerberb@zenez.com> ZENEZ 1042 East Fort Union #135, Midvale Utah 84047

Daniel Barkalow· Jun 7, 2008, 03:40 UTC · re: Boyd Lynn Gerber · lore

Re: [PATCH] 0003 This patch is to allow 12 different OS's to compile and run git.

On Fri, 6 Jun 2008, Boyd Lynn Gerber wrote:
Show 73 quoted lines
> On Fri, 6 Jun 2008, Junio C Hamano wrote:
> > Boyd Lynn Gerber <gerberb@zenez.com> writes:
> > I guess the patch text itself seems to be getting reasonable, and perhaps
> > the next few rounds would be to fix the commit log message ;-)
> 
> I have it the same, without all the >> as I first posted, but I agree. 
> that it needs some tweaking.
>  
> > > diff --git a/Makefile b/Makefile
> > > index cce5a6e..000bf1f 100644
> > > --- a/Makefile
> > > +++ b/Makefile
> > > @@ -165,6 +165,11 @@ uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
> > >  # CFLAGS and LDFLAGS are for the users to override from the command line.
> > >  
> > >  CFLAGS = -g -O2 -Wall
> > > +ifeq ($(uname_S),SCO_SV)
> > > +	ifeq ($(uname_R),3.2)
> > > +		CFLAGS = -O2
> > > +	endif
> > > +endif
> > 
> > What makes SCO_SV so special that this platform specific tweak does not
> > live in "Platform specific tweaks" section like others?
> > 
> > CFLAGS is for the user to oerride from the command line, and I do not very
> > much like any tweaks in Makefile.  I'd suggest dropping this hunk.
> > 
> > > @@ -564,6 +569,42 @@ endif
> > >  ifeq ($(uname_S),GNU/kFreeBSD)
> > >  	NO_STRLCPY = YesPlease
> > >  endif
> > > +ifeq ($(uname_S),UnixWare)
> > > +	CC=cc
> > 
> > s/=/ = /; you have similar one elsewhere.
> 
> I only have the one section now.  I will look at it some more.
> 
> > > +	NEEDS_SOCKET = YesPlease
> > > +	NEEDS_NSL = YesPlease
> > > +	NEEDS_SSL_WITH_CRYPTO = YesPlease
> > > +	NEEDS_LIBICONV = YesPlease
> > > +	SHELL_PATH = /usr/local/bin/bash
> > > +	NO_IPV6 = YesPlease
> > > +	NO_HSTRERROR = YesPlease
> > > +	BASIC_CFLAGS +=  -Kalloca -Kthread
> > 
> > I am only guessing what -Kalloca is, but is it for alloca(3), and if so do
> > you still need it?
> 
> I will make tests without it on the next run.  It takes about 3 hours for 
> me to get the patches to all the system review them and then run 
> everything.  Some of the machines are really slow.
> 
> > > diff --git a/git-compat-util.h b/git-compat-util.h
> > > index 01c4045..b3cd7b3 100644
> > > --- a/git-compat-util.h
> > > +++ b/git-compat-util.h
> > > @@ -39,7 +39,12 @@
> > >  /* Approximation of the length of the decimal representation of this type. */
> > >  #define decimal_length(x)	((int)(sizeof(x) * 2.56 + 0.5) + 1)
> > >  
> > > -#if !defined(__APPLE__) && !defined(__FreeBSD__)
> > > +/* Added for __USLC__ for any Novell devrived Compiler and Some Sys V 
> > > +   Added _M_UNIX for any XENIX/SCO UNIX/OpenServer less than or equal
> > > +   OpenServer 5.0.7  This is do avoided compiler hell like the other
> > > +   OS's __APPLE__ and __FreeBSD__ */
> > 
> > We generally do not do changelog inside the code comment.
> 
> Where do you put your change log stuff, to explain why you made the 
> change.  Maybe it is a bit left over from doing things for MySQL AB.
In the commit message. That is, if your commit message goes:
  Allow more systems to build git
  __USLC__ indicates a Novell-derived compiler or some SysV
  __M_UNIX indicates XENIX/SCO UNIX/OpenServer before 5.0.7
  Like Apple and BSD, both of these shouldn't have _XOPEN_SOURCE defined

then an interested user can use "git blame" on the file, and then read that info in the commit message for the commit that introduced those lines.

Also on the commit message: you should put the list of affected files after a line with just "---", so it appears in the patch but not in the commit; if we want to find out what the commit affects, we can use "git log --stat" and find out for sure. The explanation of the sign-off can probably go after the "---", too, although the "Signed-off-by" line should be above it.

	-Daniel
*This .sig left intentionally blank*
Boyd Lynn Gerber· Jun 8, 2008, 03:46 UTC · re: Daniel Barkalow · lore

Re: [PATCH] 0003 This patch is to allow 12 different OS's to compile and run git.

On Fri, 6 Jun 2008, Daniel Barkalow wrote:
Show 40 quoted lines
> On Fri, 6 Jun 2008, Boyd Lynn Gerber wrote:
> > On Fri, 6 Jun 2008, Junio C Hamano wrote:
> > > Boyd Lynn Gerber <gerberb@zenez.com> writes:
> > > > diff --git a/git-compat-util.h b/git-compat-util.h
> > > > index 01c4045..b3cd7b3 100644
> > > > --- a/git-compat-util.h
> > > > +++ b/git-compat-util.h
> > > > @@ -39,7 +39,12 @@
> > > >  /* Approximation of the length of the decimal representation of this type. */
> > > >  #define decimal_length(x)	((int)(sizeof(x) * 2.56 + 0.5) + 1)
> > > >  
> > > > -#if !defined(__APPLE__) && !defined(__FreeBSD__)
> > > > +/* Added for __USLC__ for any Novell devrived Compiler and Some Sys V 
> > > > +   Added _M_UNIX for any XENIX/SCO UNIX/OpenServer less than or equal
> > > > +   OpenServer 5.0.7  This is do avoided compiler hell like the other
> > > > +   OS's __APPLE__ and __FreeBSD__ */
> > > 
> > > We generally do not do changelog inside the code comment.
> > 
> > Where do you put your change log stuff, to explain why you made the 
> > change.  Maybe it is a bit left over from doing things for MySQL AB.
> 
> In the commit message. That is, if your commit message goes:
> 
>   Allow more systems to build git
> 
>   __USLC__ indicates a Novell-derived compiler or some SysV
>   __M_UNIX indicates XENIX/SCO UNIX/OpenServer before 5.0.7
>   Like Apple and BSD, both of these shouldn't have _XOPEN_SOURCE defined
> 
> then an interested user can use "git blame" on the file, and then read 
> that info in the commit message for the commit that introduced those 
> lines.
> 
> Also on the commit message: you should put the list of affected files 
> after a line with just "---", so it appears in the patch but not in the 
> commit; if we want to find out what the commit affects, we can use "git 
> log --stat" and find out for sure. The explanation of the sign-off can 
> probably go after the "---", too, although the "Signed-off-by" line should 
> be above it.
So I should have

--- Makefile

Add changes for System V, UnixWare, SCO OS's

--- git-compat-util.h

__USLC__ indicates UNIX System Labs Corperation (USLC), or a Novell-derived compiler and/or some SysV based OS's.

__M_UNIX indicates XENIX/SCO UNIX/OpenServer before 5.0.7 and prior release of and SCO OS. It is used just like Apple and BSD, both of these shouldn't have _XOPEN_SOURCE defined.

--- progress.c

Changes for older OS's that do not support the current methods for allocation of memory.

-- Boyd Gerber <gerberb@zenez.com> ZENEZ 1042 East Fort Union #135, Midvale Utah 84047

Junio C Hamano· Jun 8, 2008, 07:45 UTC · re: Boyd Lynn Gerber · lore

Re: [PATCH] 0003 This patch is to allow 12 different OS's to compile and run git.

Boyd Lynn Gerber <gerberb@zenez.com> writes:
> So I should have
> ... (deleted)
More like this:
    From: Boyd Lynn Gerber <gerberb@zenez.com>
    Subject: [PATCH] Port to other 12 platforms
    Date: Sat, 7 Jun 2008 21:46:48 -0600
    To: git@vger.kernel.org
    Cc: gitster@pobox.com
    This adds support to compile git on 12 platforms (<<whichever one you
    ported including UnixWare, SCO,... are listed here.>>).
    __USLC__ indicates UNIX System Labs Corperation (USLC), or a 
    Novell-derived compiler and/or some SysV based OS's.  __M_UNIX indicates
    XENIX/SCO UNIX/OpenServer before 5.0.7 and prior  release of and SCO OS.
    Like Apple and BSD, both of these do not want _XOPEN_SOURCE defined to
    allow use of <<the symbols that is hidden if you have _XOPEN_SOURCE
    defined>>.
    Signed-off-by: Boyd Lynn Gerber <gerberb@zenez.com>
    ---
    << "git diff --stat -p" output for the patch here >>

without removal of dynamic-sized array from progress.c, which is not really part of specific port to these 12 platforms, but is a more generic "portability fix", which might read like this:

    From: Boyd Lynn Gerber <gerberb@zenez.com>
    Subject: [PATCH] progress.c: avoid use of dynamic-sized array
    Date: Sat, 7 Jun 2008 21:46:48 -0600
    To: git@vger.kernel.org
    Cc: gitster@pobox.com
    Dynamically sized arrays are gcc and C99 construct.  It sometimes is
    nice to use them but hurts portability to older compilers.  This
    removes the only use of the construct in stop_progress_msg(); the
    function is about writing out a single line of message, and the
    existing callers of this function feed messages of only bounded size
    anyway, so use of dynamic array is simply overkill.
    Signed-off-by: Boyd Lynn Gerber <gerberb@zenez.com>
    ---
    << "git diff --stat -p" output for the patch here >>
Boyd Lynn Gerber· Jun 8, 2008, 16:57 UTC · re: Junio C Hamano · lore

[PATCH] progress.c: avoid use of dynamic-sized array

Dynamically sized arrays are gcc and C99 construct. Using them hurts portability to older compilers, although using them is nice in this case it is not desirable. This patch removes the only use of the construct in stop_progress_msg(); the function is about writing out a single line of a message, and the existing callers of this function feed messages of only bounded size anyway, so use of dynamic array is simply overkill.

This is with suggestions and modifications from

Daniel Barkalow <barkalow@iabervon.org> Junio C Hamano <gitster@pobox.com> Thomas Harning <harningt@gmail.com> Jeremy Maitin-Shepard <jbms@cmu.edu>

Signed-off-by: Boyd Lynn Gerber <gerberb@zenez.com>

-- Boyd Gerber <gerberb@zenez.com> ZENEZ 1042 East Fort Union #135, Midvale Utah 84047

---
        Developer's Certificate of Origin 1.1
        By making a contribution to this project, I certify that:
        (a) The contribution was created in whole or in part by me and I
            have the right to submit it under the open source license
            indicated in the file; or
        (b) The contribution is based upon previous work that, to the best
            of my knowledge, is covered under an appropriate open source
            license and I have the right under that license to submit that
            work with modifications, whether created in whole or in part
            by me, under the same open source license (unless I am
            permitted to submit under a different license), as indicated
            in the file; or
        (c) The contribution was provided directly to me by some other
            person who certified (a), (b) or (c) and I have not modified
            it.
        (d) I understand and agree that this project and the contribution
            are public and that a record of the contribution (including all
            personal information I submit with it, including my sign-off) is
            maintained indefinitely and may be redistributed consistent with
            this project or the open source license(s) involved.

--- progress.c

Show changes to progress.c +8 −3
diff --git a/progress.c b/progress.c
index d19f80c..55a8687 100644
--- a/progress.c
+++ b/progress.c
@@ -241,16 +241,21 @@ void stop_progress_msg(struct progress **p_progress, const char *msg)
 	*p_progress = NULL;
 	if (progress->last_value != -1) {
 		/* Force the last update */
-		char buf[strlen(msg) + 5];
+		char buf[128], *bufp;
+		size_t len = strlen(msg) + 5;
 		struct throughput *tp = progress->throughput;
+
+		bufp = (len < sizeof(buf)) ? buf : xmalloc(len + 1);
 		if (tp) {
 			unsigned int rate = !tp->avg_misecs ? 0 :
 					tp->avg_bytes / tp->avg_misecs;
 			throughput_string(tp, tp->curr_total, rate);
 		}
 		progress_update = 1;
-		sprintf(buf, ", %s.\n", msg);
-		display(progress, progress->last_value, buf);
+		sprintf(bufp, ", %s.\n", msg);
+		display(progress, progress->last_value, bufp);
+		if (buf != bufp)
+			free(bufp);
 	}
 	clear_progress_signal();
 	free(progress->throughput);
-- 
1.5.2.4


--
Boyd Gerber <gerberb@zenez.com>
ZENEZ	1042 East Fort Union #135, Midvale Utah  84047
Boyd Lynn Gerber· Jun 8, 2008, 17:07 UTC · re: Junio C Hamano · lore

[PATCH] Port to 12 other Platforms.

This patch adds support to compile git on 12 additional platforms. The platforms are based on UNIX Systems Labs (USL)/Novell/SYS V code base.

This patch also adds support for Novell UnixWare 2.x.x, UnixWare 7.1.4 and older, OpenServer 5.0.7 and older OpenServer 6.0.X, and SCO pre OSR 5 platforms to build and run git.

This is with suggestions and modifications from

Daniel Barkalow <barkalow@iabervon.org> Junio C Hamano <gitster@pobox.com> Thomas Harning <harningt@gmail.com> Jeremy Maitin-Shepard <jbms@cmu.edu>

Signed-off-by: Boyd Lynn Gerber <gerberb@zenez.com>

-- Boyd Gerber <gerberb@zenez.com> ZENEZ 1042 East Fort Union #135, Midvale Utah 84047

---
        Developer's Certificate of Origin 1.1
        By making a contribution to this project, I certify that:
        (a) The contribution was created in whole or in part by me and I
            have the right to submit it under the open source license
            indicated in the file; or
        (b) The contribution is based upon previous work that, to the best
            of my knowledge, is covered under an appropriate open source
            license and I have the right under that license to submit that
            work with modifications, whether created in whole or in part
            by me, under the same open source license (unless I am
            permitted to submit under a different license), as indicated
            in the file; or
        (c) The contribution was provided directly to me by some other
            person who certified (a), (b) or (c) and I have not modified
            it.
        (d) I understand and agree that this project and the contribution
            are public and that a record of the contribution (including all
            personal information I submit with it, including my sign-off) is
            maintained indefinitely and may be redistributed consistent with
            this project or the open source license(s) involved.

--- Makefile

Add changes for System V, UnixWare, SCO OS's

--- git-compat-util.h

__USLC__ indicates UNIX System Labs Corperation (USLC), or a Novell-derived compiler and/or some SysV based OS's.

__M_UNIX indicates XENIX/SCO UNIX/OpenServer 5.0.7 and prior releases of the SCO OS's. It is used just like Apple and BSD, both of these shouldn't have _XOPEN_SOURCE defined.

Show changes to 2 files +40 −1

Makefile, git-compat-util.h

diff --git a/Makefile b/Makefile
index cce5a6e..026de2f 100644
--- a/Makefile
+++ b/Makefile
@@ -564,6 +564,45 @@ endif
 ifeq ($(uname_S),GNU/kFreeBSD)
 	NO_STRLCPY = YesPlease
 endif
+ifeq ($(uname_S),UnixWare)
+	CC=cc
+	NEEDS_SOCKET = YesPlease
+	NEEDS_NSL = YesPlease
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	SHELL_PATH = /usr/local/bin/bash
+	NO_IPV6 = YesPlease
+	NO_HSTRERROR = YesPlease
+	BASIC_CFLAGS += -Kthread
+	BASIC_CFLAGS += -I/usr/local/include
+	BASIC_LDFLAGS += -L/usr/local/lib
+	INSTALL = ginstall
+	TAR = gtar
+	NO_STRCASESTR = YesPlease
+	NO_MEMMEM = YesPlease
+endif
+ifeq ($(uname_S),SCO_SV)
+	ifeq ($(uname_R),3.2)
+		CFLAGS = -O2
+	endif
+	ifeq ($(uname_R),5)
+		CC=cc
+		BASIC_CFLAGS += -Kthread
+	endif
+	NEEDS_SOCKET = YesPlease
+	NEEDS_NSL = YesPlease
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	SHELL_PATH = /usr/bin/bash
+	NO_IPV6 = YesPlease
+	NO_HSTRERROR = YesPlease
+	BASIC_CFLAGS += -I/usr/local/include
+	BASIC_LDFLAGS += -L/usr/local/lib
+	NO_STRCASESTR = YesPlease
+	NO_MEMMEM = YesPlease
+	INSTALL = ginstall
+	TAR = gtar
+endif
 ifeq ($(uname_S),Darwin)
 	NEEDS_SSL_WITH_CRYPTO = YesPlease
 	NEEDS_LIBICONV = YesPlease
diff --git a/git-compat-util.h b/git-compat-util.h
index 01c4045..c04e8ba 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -39,7 +39,7 @@
 /* Approximation of the length of the decimal representation of this type. */
 #define decimal_length(x)	((int)(sizeof(x) * 2.56 + 0.5) + 1)
 
-#if !defined(__APPLE__) && !defined(__FreeBSD__)
+#if !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !defined(_M_UNIX)
 #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
 #endif
-- 
1.5.2.4


--
Boyd Gerber <gerberb@zenez.com>
ZENEZ	1042 East Fort Union #135, Midvale Utah  84047
Boyd Lynn Gerber· Jun 8, 2008, 03:50 UTC · re: Daniel Barkalow · lore

Re: [PATCH] 0004 This patch is to allow 12 different OS's to compile and run git.

This patch allows some older OS's, UNIX Systems Labs (USL)/Novell and SYS V based OS's, SCO OpenServer 5.0.X, SCO UnixWare 7.1.4, OpenServer 6.0.X and SCO pre OSR 5 OS's to build and run git. Applied suggestions from list.

        Developer's Certificate of Origin 1.1
        By making a contribution to this project, I certify that:
        (a) The contribution was created in whole or in part by me and I
            have the right to submit it under the open source license
            indicated in the file; or
        (b) The contribution is based upon previous work that, to the best
            of my knowledge, is covered under an appropriate open source
            license and I have the right under that license to submit that
            work with modifications, whether created in whole or in part
            by me, under the same open source license (unless I am
            permitted to submit under a different license), as indicated
            in the file; or
        (c) The contribution was provided directly to me by some other
            person who certified (a), (b) or (c) and I have not modified
            it.
        (d) I understand and agree that this project and the contribution
            are public and that a record of the contribution (including all
            personal information I submit with it, including my sign-off) is
            maintained indefinitely and may be redistributed consistent with
            this project or the open source license(s) involved.
Signed-off-by: Boyd Lynn Gerber <gerberb@zenez.com>

-- Boyd Gerber <gerberb@zenez.com> ZENEZ 1042 East Fort Union #135, Midvale Utah 84047

--- Makefile

Add changes for System V, UnixWare, SCO OS's

--- git-compat-util.h

__USLC__ indicates UNIX System Labs Corperation (USLC), or a Novell-derived compiler and/or some SysV based OS's.

__M_UNIX indicates XENIX/SCO UNIX/OpenServer before 5.0.7 and prior release of and SCO OS. It is used just like Apple and BSD, both of these shouldn't have _XOPEN_SOURCE defined.

--- progress.c

Changes for older OS's that do not support the current methods for allocation of memory.

Show changes to 3 files +48 −5

Makefile, git-compat-util.h, progress.c

diff --git a/Makefile b/Makefile
index cce5a6e..bd65509 100644
--- a/Makefile
+++ b/Makefile
@@ -164,7 +164,6 @@ uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
 
 # CFLAGS and LDFLAGS are for the users to override from the command line.
 
-CFLAGS = -g -O2 -Wall
 LDFLAGS =
 ALL_CFLAGS = $(CFLAGS)
 ALL_LDFLAGS = $(LDFLAGS)
@@ -564,6 +563,45 @@ endif
 ifeq ($(uname_S),GNU/kFreeBSD)
 	NO_STRLCPY = YesPlease
 endif
+ifeq ($(uname_S),UnixWare)
+	CC=cc
+	NEEDS_SOCKET = YesPlease
+	NEEDS_NSL = YesPlease
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	SHELL_PATH = /usr/local/bin/bash
+	NO_IPV6 = YesPlease
+	NO_HSTRERROR = YesPlease
+	BASIC_CFLAGS += -Kthread
+	BASIC_CFLAGS += -I/usr/local/include
+	BASIC_LDFLAGS += -L/usr/local/lib
+	INSTALL = ginstall
+	TAR = gtar
+	NO_STRCASESTR = YesPlease
+	NO_MEMMEM = YesPlease
+endif
+ifeq ($(uname_S),SCO_SV)
+	ifeq ($(uname_R),3.2)
+		CFLAGS = -O2
+	endif
+	ifeq ($(uname_R),5)
+		CC=cc
+		BASIC_CFLAGS += -Kthread
+	endif
+	NEEDS_SOCKET = YesPlease
+	NEEDS_NSL = YesPlease
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	SHELL_PATH = /usr/bin/bash
+	NO_IPV6 = YesPlease
+	NO_HSTRERROR = YesPlease
+	BASIC_CFLAGS += -I/usr/local/include
+	BASIC_LDFLAGS += -L/usr/local/lib
+	NO_STRCASESTR = YesPlease
+	NO_MEMMEM = YesPlease
+	INSTALL = ginstall
+	TAR = gtar
+endif
 ifeq ($(uname_S),Darwin)
 	NEEDS_SSL_WITH_CRYPTO = YesPlease
 	NEEDS_LIBICONV = YesPlease
diff --git a/git-compat-util.h b/git-compat-util.h
index 01c4045..c04e8ba 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -39,7 +39,7 @@
 /* Approximation of the length of the decimal representation of this type. */
 #define decimal_length(x)	((int)(sizeof(x) * 2.56 + 0.5) + 1)
 
-#if !defined(__APPLE__) && !defined(__FreeBSD__)
+#if !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !defined(_M_UNIX)
 #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
 #endif
diff --git a/progress.c b/progress.c
index d19f80c..55a8687 100644
--- a/progress.c
+++ b/progress.c
@@ -241,16 +241,21 @@ void stop_progress_msg(struct progress **p_progress, const char *msg)
 	*p_progress = NULL;
 	if (progress->last_value != -1) {
 		/* Force the last update */
-		char buf[strlen(msg) + 5];
+		char buf[128], *bufp;
+		size_t len = strlen(msg) + 5;
 		struct throughput *tp = progress->throughput;
+
+		bufp = (len < sizeof(buf)) ? buf : xmalloc(len + 1);
 		if (tp) {
 			unsigned int rate = !tp->avg_misecs ? 0 :
 					tp->avg_bytes / tp->avg_misecs;
 			throughput_string(tp, tp->curr_total, rate);
 		}
 		progress_update = 1;
-		sprintf(buf, ", %s.\n", msg);
-		display(progress, progress->last_value, buf);
+		sprintf(bufp, ", %s.\n", msg);
+		display(progress, progress->last_value, bufp);
+		if (buf != bufp)
+			free(bufp);
 	}
 	clear_progress_signal();
 	free(progress->throughput);
-- 
1.5.2.4


--
Boyd Gerber <gerberb@zenez.com>
ZENEZ	1042 East Fort Union #135, Midvale Utah  84047
Boyd Lynn Gerber· Jun 8, 2008, 07:22 UTC · re: Boyd Lynn Gerber · lore

Re: [PATCH] 0004 This patch is to allow 12 different OS's to compile and run git.

Sorry, I forgot to copy the real 00* file to the machine I work on. Below, is what should have been sent.

-- Boyd Gerber <gerberb@zenez.com> ZENEZ 1042 East Fort Union #135, Midvale Utah 84047

--------------------------------Cut-Here-------------------------------
Subject: [PATCH] This patch is to allow 12 different OS's to compile and run git.

This patch allows some older OS's, UNIX Systems Labs (USL)/Novell and SYS V based OS's, SCO OpenServer 5.0.X, SCO UnixWare 7.1.4, OpenServer 6.0.X and SCO pre OSR 5 OS's to build and run git. Applied suggestions from list.

Signed-off-by: Boyd Lynn Gerber <gerberb@zenez.com>

-- Boyd Gerber <gerberb@zenez.com> ZENEZ 1042 East Fort Union #135, Midvale Utah 84047

---
        Developer's Certificate of Origin 1.1
        By making a contribution to this project, I certify that:
        (a) The contribution was created in whole or in part by me and I
            have the right to submit it under the open source license
            indicated in the file; or
        (b) The contribution is based upon previous work that, to the best
            of my knowledge, is covered under an appropriate open source
            license and I have the right under that license to submit that
            work with modifications, whether created in whole or in part
            by me, under the same open source license (unless I am
            permitted to submit under a different license), as indicated
            in the file; or
        (c) The contribution was provided directly to me by some other
            person who certified (a), (b) or (c) and I have not modified
            it.
        (d) I understand and agree that this project and the contribution
            are public and that a record of the contribution (including all
            personal information I submit with it, including my sign-off) is
            maintained indefinitely and may be redistributed consistent with
            this project or the open source license(s) involved.

--- Makefile

Add changes for System V, UnixWare, SCO OS's

--- git-compat-util.h

__USLC__ indicates UNIX System Labs Corperation (USLC), or a Novell-derived compiler and/or some SysV based OS's.

__M_UNIX indicates XENIX/SCO UNIX/OpenServer 5.0.7 and prior release of and SCO OS. It is used just like Apple and BSD, both of these shouldn't have _XOPEN_SOURCE defined.

--- progress.c

Changes for older OS's that do not support the current methods for allocation of memory.

Show changes to 3 files +48 −4

Makefile, git-compat-util.h, progress.c

diff --git a/Makefile b/Makefile
index cce5a6e..026de2f 100644
--- a/Makefile
+++ b/Makefile
@@ -564,6 +564,45 @@ endif
 ifeq ($(uname_S),GNU/kFreeBSD)
 	NO_STRLCPY = YesPlease
 endif
+ifeq ($(uname_S),UnixWare)
+	CC=cc
+	NEEDS_SOCKET = YesPlease
+	NEEDS_NSL = YesPlease
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	SHELL_PATH = /usr/local/bin/bash
+	NO_IPV6 = YesPlease
+	NO_HSTRERROR = YesPlease
+	BASIC_CFLAGS += -Kthread
+	BASIC_CFLAGS += -I/usr/local/include
+	BASIC_LDFLAGS += -L/usr/local/lib
+	INSTALL = ginstall
+	TAR = gtar
+	NO_STRCASESTR = YesPlease
+	NO_MEMMEM = YesPlease
+endif
+ifeq ($(uname_S),SCO_SV)
+	ifeq ($(uname_R),3.2)
+		CFLAGS = -O2
+	endif
+	ifeq ($(uname_R),5)
+		CC=cc
+		BASIC_CFLAGS += -Kthread
+	endif
+	NEEDS_SOCKET = YesPlease
+	NEEDS_NSL = YesPlease
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	SHELL_PATH = /usr/bin/bash
+	NO_IPV6 = YesPlease
+	NO_HSTRERROR = YesPlease
+	BASIC_CFLAGS += -I/usr/local/include
+	BASIC_LDFLAGS += -L/usr/local/lib
+	NO_STRCASESTR = YesPlease
+	NO_MEMMEM = YesPlease
+	INSTALL = ginstall
+	TAR = gtar
+endif
 ifeq ($(uname_S),Darwin)
 	NEEDS_SSL_WITH_CRYPTO = YesPlease
 	NEEDS_LIBICONV = YesPlease
diff --git a/git-compat-util.h b/git-compat-util.h
index 01c4045..c04e8ba 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -39,7 +39,7 @@
 /* Approximation of the length of the decimal representation of this type. */
 #define decimal_length(x)	((int)(sizeof(x) * 2.56 + 0.5) + 1)
 
-#if !defined(__APPLE__) && !defined(__FreeBSD__)
+#if !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !defined(_M_UNIX)
 #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
 #endif
diff --git a/progress.c b/progress.c
index d19f80c..55a8687 100644
--- a/progress.c
+++ b/progress.c
@@ -241,16 +241,21 @@ void stop_progress_msg(struct progress **p_progress, const char *msg)
 	*p_progress = NULL;
 	if (progress->last_value != -1) {
 		/* Force the last update */
-		char buf[strlen(msg) + 5];
+		char buf[128], *bufp;
+		size_t len = strlen(msg) + 5;
 		struct throughput *tp = progress->throughput;
+
+		bufp = (len < sizeof(buf)) ? buf : xmalloc(len + 1);
 		if (tp) {
 			unsigned int rate = !tp->avg_misecs ? 0 :
 					tp->avg_bytes / tp->avg_misecs;
 			throughput_string(tp, tp->curr_total, rate);
 		}
 		progress_update = 1;
-		sprintf(buf, ", %s.\n", msg);
-		display(progress, progress->last_value, buf);
+		sprintf(bufp, ", %s.\n", msg);
+		display(progress, progress->last_value, bufp);
+		if (buf != bufp)
+			free(bufp);
 	}
 	clear_progress_signal();
 	free(progress->throughput);
-- 
1.5.2.4

--
Boyd Gerber <gerberb@zenez.com>
ZENEZ	1042 East Fort Union #135, Midvale Utah  84047
Thomas Harning· Jun 6, 2008, 19:46 UTC · re: Boyd Lynn Gerber · lore

Re: [PATCH] This patch is to allow 12 different OS's to compile and run git.

On Jun 6, 2008, at 3:34 PM, Boyd Lynn Gerber wrote:
Show 16 quoted lines
>
> #ifdef SNPRINTF_RETURNS_BOGUS
> #define snprintf git_snprintf
> diff --git a/progress.c b/progress.c
> index d19f80c..11a0841 100644
> --- a/progress.c
> +++ b/progress.c
> @@ -241,7 +241,8 @@ void stop_progress_msg(struct progress  
> **p_progress, const char *msg)
> 	*p_progress = NULL;
> 	if (progress->last_value != -1) {
> 		/* Force the last update */
> -		char buf[strlen(msg) + 5];
> +		/* char buf[strlen(msg) + 5]; */
> +		char *buf = malloc (strlen(msg) + 5 );
> 		struct throughput *tp = progress->throughput;

Hrm... malloc w/o free... perhaps you should use a something like alloca /IFF/ C99/gnu isn't available for the dynamic buffer allocation...

Daniel Barkalow· Jun 6, 2008, 22:58 UTC · re: Boyd Lynn Gerber · lore

Re: [PATCH] This patch is to allow 12 different OS's to compile and run git.

On Fri, 6 Jun 2008, Boyd Lynn Gerber wrote:
Show 64 quoted lines
> This patch has patches to
> 
> Makefile
> git-compat-util.h
> progress.c
> 
> This patch allows some older OS's, SCO OpenServer 5.0.X, SCO UnixWare 7.1.4,
> and OpenServer 6.0.X to build and run git.
> 
>         Developer's Certificate of Origin 1.1
> 
>         By making a contribution to this project, I certify that:
> 
>         (a) The contribution was created in whole or in part by me and I
>             have the right to submit it under the open source license
>             indicated in the file; or
> 
>         (b) The contribution is based upon previous work that, to the best
>             of my knowledge, is covered under an appropriate open source
>             license and I have the right under that license to submit that
>             work with modifications, whether created in whole or in part
>             by me, under the same open source license (unless I am
>             permitted to submit under a different license), as indicated
>             in the file; or
> 
>         (c) The contribution was provided directly to me by some other
>             person who certified (a), (b) or (c) and I have not modified
>             it.
> 
> 	(d) I understand and agree that this project and the contribution
> 	    are public and that a record of the contribution (including all
> 	    personal information I submit with it, including my sign-off) is
> 	    maintained indefinitely and may be redistributed consistent with
> 	    this project or the open source license(s) involved.
> 
> Signed-off-by: Boyd Lynn Gerber <gerberb@zenez.com>
> 
> --
> Boyd Gerber <gerberb@zenez.com>
> ZENEZ	1042 East Fort Union #135, Midvale Utah  84047
> 
> 
> diff --git a/Makefile b/Makefile
> index cce5a6e..6df008a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -165,6 +165,20 @@ uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
>  # CFLAGS and LDFLAGS are for the users to override from the command line.
>  
>  CFLAGS = -g -O2 -Wall
> +ifeq ($(uname_S),SCO_SV)
> +  ifeq ($(uname_R),3.2)
> +#    CFLAGS = -g -O2
> +    CFLAGS = -g
> +  endif
> +  ifeq ($(uname_R),5)
> +    CFLAGS = -g -O2 -Wall
> +#    CFLAGS = -g -O2
> +  endif
> +endif
> +ifeq ($(uname_S),UnixWare)
> +    CFLAGS = -g -O2 -Wall
> +#    CFLAGS = -g -O2
> +endif

Might be better to have something for CFLAGS to filter out. Also, as a general rule, remove old lines instead of commentting them out. If we want to undo a change, we can get it out of the version control. :) (More of these below)

Also, only the SCO_SV 3.2 one actually does anything here, right?
Show 10 quoted lines
>  LDFLAGS =
>  ALL_CFLAGS = $(CFLAGS)
>  ALL_LDFLAGS = $(LDFLAGS)
> @@ -207,7 +221,8 @@ GITWEB_SITE_FOOTER =
>  
>  export prefix bindir gitexecdir sharedir template_dir htmldir sysconfdir
>  
> -CC = gcc
> +#CC = gcc
> +CC = "cc"

Probably ought to make this conditional on a flag that says that "cc" works and "gcc" isn't better; there are a lot of systems, IIRC, where "cc" is a lousy vendor compiler (unless you bought the expensive vendor compiler) and "gcc" is the modern working compiler that everybody has installed.

Show 67 quoted lines
>  AR = ar
>  RM = rm -f
>  TAR = tar
> @@ -564,6 +579,42 @@ endif
>  ifeq ($(uname_S),GNU/kFreeBSD)
>  	NO_STRLCPY = YesPlease
>  endif
> +ifeq ($(uname_S),UnixWare)
> +	NEEDS_SOCKET = YesPlease
> +#	NEEDS_NSL = YesPlease
> +	NEEDS_SSL_WITH_CRYPTO = YesPlease
> +	NEEDS_LIBICONV = YesPlease
> +	SHELL_PATH = /usr/local/bin/bash
> +	NO_IPV6 = YesPlease
> +	NO_HSTRERROR = YesPlease
> +#	BASIC_CFLAGS +=  -E -H
> +	BASIC_CFLAGS +=  -Kalloca -Kthread
> +	BASIC_CFLAGS += -I/usr/local/include
> +	BASIC_LDFLAGS += -L/usr/local/lib
> +	INSTALL = ginstall
> +	TAR = gtar
> +	NO_STRCASESTR = YesPlease
> +	NO_MEMMEM = YesPlease
> +endif
> +ifeq ($(uname_S),SCO_SV)
> +	NEEDS_SOCKET = YesPlease
> +#	NEEDS_NSL = YesPlease
> +	NEEDS_SSL_WITH_CRYPTO = YesPlease
> +	NEEDS_LIBICONV = YesPlease
> +	SHELL_PATH = /usr/bin/bash
> +	NO_IPV6 = YesPlease
> +#	NO_HSTRERROR = YesPlease
> +#	BASIC_CFLAGS +=  -E -H
> +      ifeq ($(uname_R),5)
> +	BASIC_CFLAGS +=  -Kalloca -Kthread
> +      endif
> +#	BASIC_CFLAGS += -I/usr/local/include
> +#	BASIC_LDFLAGS += -L/usr/local/lib
> +	NO_STRCASESTR = YesPlease
> +	NO_MEMMEM = YesPlease
> +	INSTALL = ginstall
> +	TAR = gtar
> +endif
>  ifeq ($(uname_S),Darwin)
>  	NEEDS_SSL_WITH_CRYPTO = YesPlease
>  	NEEDS_LIBICONV = YesPlease
> diff --git a/git-compat-util.h b/git-compat-util.h
> index 01c4045..b57041c 100644
> --- a/git-compat-util.h
> +++ b/git-compat-util.h
> @@ -39,7 +39,7 @@
>  /* Approximation of the length of the decimal representation of this type. */
>  #define decimal_length(x)	((int)(sizeof(x) * 2.56 + 0.5) + 1)
>  
> -#if !defined(__APPLE__) && !defined(__FreeBSD__)
> +#if !defined(__APPLE__) && !defined(__FreeBSD__ ) && !defined(__USLC__) && !defined(_M_UNIX)
>  #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
>  #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
>  #endif
> @@ -89,6 +89,10 @@
>  #include <grp.h>
>  #define _ALL_SOURCE 1
>  #endif
> +#if defined(__USLC__)
> +#undef _XOPEN_SOURCE
> +#include <grp.h>
> +#endif
Didn't you avoid defining _XOPEN_SOURCE in this case?
Show 8 quoted lines
>  
>  #ifndef NO_ICONV
>  #include <iconv.h>
> @@ -206,12 +210,15 @@ void *gitmemmem(const void *haystack, size_t haystacklen,
>  #endif
>  
>  #ifdef FREAD_READS_DIRECTORIES
> +#if !defined (__USLC__)
Can't you not define FREAD_READS_DIRECTORIES?
Show 8 quoted lines
>  #ifdef fopen
>  #undef fopen
>  #endif
>  #define fopen(a,b) git_fopen(a,b)
>  extern FILE *git_fopen(const char*, const char*);
>  #endif
> +#endif
> +#endif
This seems wrong; it looks like you've added more #endifs than #ifs.
Show 14 quoted lines
>  
>  #ifdef SNPRINTF_RETURNS_BOGUS
>  #define snprintf git_snprintf
> diff --git a/progress.c b/progress.c
> index d19f80c..11a0841 100644
> --- a/progress.c
> +++ b/progress.c
> @@ -241,7 +241,8 @@ void stop_progress_msg(struct progress **p_progress, const char *msg)
>  	*p_progress = NULL;
>  	if (progress->last_value != -1) {
>  		/* Force the last update */
> -		char buf[strlen(msg) + 5];
> +		/* char buf[strlen(msg) + 5]; */
> +		char *buf = malloc (strlen(msg) + 5 );

Do we really have exactly one use of this pattern? I thought we either did it more or excluded it by policy. Aside from not leaking the memory and not leaving the old version in a comment, it's probably the right change.

Incidentally, you might want to look into "sparse", and getting them have an optional warning for code like this that might not be supported by some compilers the project wants to support but doesn't actually use for development regularly.

	-Daniel
*This .sig left intentionally blank*
Boyd Lynn Gerber· Jun 6, 2008, 23:17 UTC · re: Daniel Barkalow · lore

Re: [PATCH] This patch is to allow 12 different OS's to compile and run git.

On Fri, 6 Jun 2008, Daniel Barkalow wrote:
Show 6 quoted lines
> On Fri, 6 Jun 2008, Boyd Lynn Gerber wrote:
> > This patch has patches to
> > 
> > Makefile
> > git-compat-util.h
> > progress.c
...
Show 29 quoted lines
> > diff --git a/Makefile b/Makefile
> > index cce5a6e..6df008a 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -165,6 +165,20 @@ uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
> >  # CFLAGS and LDFLAGS are for the users to override from the command line.
> >  
> >  CFLAGS = -g -O2 -Wall
> > +ifeq ($(uname_S),SCO_SV)
> > +  ifeq ($(uname_R),3.2)
> > +#    CFLAGS = -g -O2
> > +    CFLAGS = -g
> > +  endif
> > +  ifeq ($(uname_R),5)
> > +    CFLAGS = -g -O2 -Wall
> > +#    CFLAGS = -g -O2
> > +  endif
> > +endif
> > +ifeq ($(uname_S),UnixWare)
> > +    CFLAGS = -g -O2 -Wall
> > +#    CFLAGS = -g -O2
> > +endif
> 
> Might be better to have something for CFLAGS to filter out. Also, as a 
> general rule, remove old lines instead of commentting them out. If we want 
> to undo a change, we can get it out of the version control. :) (More of 
> these below)
> 
> Also, only the SCO_SV 3.2 one actually does anything here, right?

SCO has SCO_SV defined for all OpenServer/SCO Unix/XENIX Versions from about 1983/4. My memory is a bit fogey on the exact first Release of XENIX. The problem is that with OpenServer 6 you have to use the UnixWare stuff. OpenServer 6 is a highly modified Unixware 7.1.4, but changed for 98 % of the OpenServer 5 stuff. I am running XENIX binaries from the mid to late 80's on it. So you have to do some really strange things because of it. I had git working on SCO UNIX 3.2v4.2/Open Server/ODT 3.0. I have to use gcc and FSU-threads for threads. FSU-threads is a user threads.

Show 75 quoted lines
> Probably ought to make this conditional on a flag that says that "cc" 
> works and "gcc" isn't better; there are a lot of systems, IIRC, where "cc" 
> is a lousy vendor compiler (unless you bought the expensive vendor 
> compiler) and "gcc" is the modern working compiler that everybody has 
> installed.
> 
> >  AR = ar
> >  RM = rm -f
> >  TAR = tar
> > @@ -564,6 +579,42 @@ endif
> >  ifeq ($(uname_S),GNU/kFreeBSD)
> >  	NO_STRLCPY = YesPlease
> >  endif
> > +ifeq ($(uname_S),UnixWare)
> > +	NEEDS_SOCKET = YesPlease
> > +#	NEEDS_NSL = YesPlease
> > +	NEEDS_SSL_WITH_CRYPTO = YesPlease
> > +	NEEDS_LIBICONV = YesPlease
> > +	SHELL_PATH = /usr/local/bin/bash
> > +	NO_IPV6 = YesPlease
> > +	NO_HSTRERROR = YesPlease
> > +#	BASIC_CFLAGS +=  -E -H
> > +	BASIC_CFLAGS +=  -Kalloca -Kthread
> > +	BASIC_CFLAGS += -I/usr/local/include
> > +	BASIC_LDFLAGS += -L/usr/local/lib
> > +	INSTALL = ginstall
> > +	TAR = gtar
> > +	NO_STRCASESTR = YesPlease
> > +	NO_MEMMEM = YesPlease
> > +endif
> > +ifeq ($(uname_S),SCO_SV)
> > +	NEEDS_SOCKET = YesPlease
> > +#	NEEDS_NSL = YesPlease
> > +	NEEDS_SSL_WITH_CRYPTO = YesPlease
> > +	NEEDS_LIBICONV = YesPlease
> > +	SHELL_PATH = /usr/bin/bash
> > +	NO_IPV6 = YesPlease
> > +#	NO_HSTRERROR = YesPlease
> > +#	BASIC_CFLAGS +=  -E -H
> > +      ifeq ($(uname_R),5)
> > +	BASIC_CFLAGS +=  -Kalloca -Kthread
> > +      endif
> > +#	BASIC_CFLAGS += -I/usr/local/include
> > +#	BASIC_LDFLAGS += -L/usr/local/lib
> > +	NO_STRCASESTR = YesPlease
> > +	NO_MEMMEM = YesPlease
> > +	INSTALL = ginstall
> > +	TAR = gtar
> > +endif
> >  ifeq ($(uname_S),Darwin)
> >  	NEEDS_SSL_WITH_CRYPTO = YesPlease
> >  	NEEDS_LIBICONV = YesPlease
> > diff --git a/git-compat-util.h b/git-compat-util.h
> > index 01c4045..b57041c 100644
> > --- a/git-compat-util.h
> > +++ b/git-compat-util.h
> > @@ -39,7 +39,7 @@
> >  /* Approximation of the length of the decimal representation of this type. */
> >  #define decimal_length(x)	((int)(sizeof(x) * 2.56 + 0.5) + 1)
> >  
> > -#if !defined(__APPLE__) && !defined(__FreeBSD__)
> > +#if !defined(__APPLE__) && !defined(__FreeBSD__ ) && !defined(__USLC__) && !defined(_M_UNIX)
> >  #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
> >  #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
> >  #endif
> > @@ -89,6 +89,10 @@
> >  #include <grp.h>
> >  #define _ALL_SOURCE 1
> >  #endif
> > +#if defined(__USLC__)
> > +#undef _XOPEN_SOURCE
> > +#include <grp.h>
> > +#endif
> 
> Didn't you avoid defining _XOPEN_SOURCE in this case?

Yes, I have to not have any _XOPEN_SOURCE because it ommits many defines that are needed by git. I was using the -E trying to track things down. The only option to get everything defined because of the masking was to remove it. I have the same problems on the other OS. This is need for any SCO OS from Open Desktop 3 and XENIX to the three SCO support OS's. OpenServer 5.0.7, UnixWare 7.1.4 and OpenServer 6. Only the last two have large file system and kernel threads. There are a couple other OS's that Novel provided code that uses the USLC. As it is from the orignal UNIX Group that Novell form when they purchase UNIX. So any UNIX from this source that uses the Novell OS compiler's needs it.

Show 10 quoted lines
> >  
> >  #ifndef NO_ICONV
> >  #include <iconv.h>
> > @@ -206,12 +210,15 @@ void *gitmemmem(const void *haystack, size_t haystacklen,
> >  #endif
> >  
> >  #ifdef FREAD_READS_DIRECTORIES
> > +#if !defined (__USLC__)
> 
> Can't you not define FREAD_READS_DIRECTORIES?
Removed see new patch that was posted.
> This seems wrong; it looks like you've added more #endifs than #ifs.
Changed in the new patch that was submitted.
 
  
Show 17 quoted lines
> >  #ifdef SNPRINTF_RETURNS_BOGUS
> >  #define snprintf git_snprintf
> > diff --git a/progress.c b/progress.c
> > index d19f80c..11a0841 100644
> > --- a/progress.c
> > +++ b/progress.c
> > @@ -241,7 +241,8 @@ void stop_progress_msg(struct progress **p_progress, const char *msg)
> >  	*p_progress = NULL;
> >  	if (progress->last_value != -1) {
> >  		/* Force the last update */
> > -		char buf[strlen(msg) + 5];
> > +		/* char buf[strlen(msg) + 5]; */
> > +		char *buf = malloc (strlen(msg) + 5 );
> 
> Do we really have exactly one use of this pattern? I thought we either did 
> it more or excluded it by policy. Aside from not leaking the memory and 
> not leaving the old version in a comment, it's probably the right change.
I only could find the one usuage.  I am now using alloca.
 
> Incidentally, you might want to look into "sparse", and getting them have 
> an optional warning for code like this that might not be supported by some 
> compilers the project wants to support but doesn't actually use for 
> development regularly.
I am, trying to understand it right now.
Thanks,

-- Boyd Gerber <gerberb@zenez.com> ZENEZ 1042 East Fort Union #135, Midvale Utah 84047

← back to recent threads