threads / discuss / 4670

Solaris 8

Subject: Solaris 8

## tl;dr

6 messages between Jun 26, 2006 and Jun 26, 2006.

replies: 5people: 2as markdown or json

Uwe Zeisberger· Jun 26, 2006, 08:09 UTC · lore
Hello,

when trying to get git running on Solaris 8 (gcc 2.95), there are several pit-falls:

1) for me, install and tar are GNUish, ginstall and gtar don't exist.
   (INSTALL = ginstall, TAR = gtar for SunOS in Makefile)
2) connect.c and merge-index.c use signal() without including signal.h
3) Solaris ships zlib 1.1.3.  That version doesn't define
   ZLIB_VERNUM.  But no, that's not my problem, ... I have it: There is
   another zlib version in /usr/local.  That's 1.2.3, defining
   ZLIB_VERNUM as 0x1230.  The compiler uses include files from
   /usr/local, but lib from /usr/lib.  Aargh, I have to dig the admins
   here...
4) libc don't know printf z and t modifier:
	alloc.c: In function `alloc_report':
	alloc.c:47: warning: unknown conversion type character `z' in format
	alloc.c:47: warning: too many arguments for format
	alloc.c:48: warning: unknown conversion type character `z' in format
	alloc.c:48: warning: too many arguments for format
	alloc.c:49: warning: unknown conversion type character `z' in format
	alloc.c:49: warning: too many arguments for format
	alloc.c:50: warning: unknown conversion type character `z' in format
	alloc.c:50: warning: too many arguments for format
	mktag.c: In function `verify_tag':
	mktag.c:69: warning: unknown conversion type character `t' in format
	mktag.c:69: warning: too many arguments for format
	mktag.c:72: warning: unknown conversion type character `t' in format
	mktag.c:72: warning: too many arguments for format
	mktag.c:77: warning: unknown conversion type character `t' in format
	mktag.c:77: warning: too many arguments for format
	mktag.c:97: warning: unknown conversion type character `t' in format
	mktag.c:97: warning: too many arguments for format
	mktag.c:104: warning: unknown conversion type character `t' in format
	mktag.c:104: warning: too many arguments for format
5) I don't understand why I get this warning for EMIT(c), but not for
   EMIT('\\'):
	quote.c:34: warning: value computed is not used
	quote.c:37: warning: value computed is not used
6) typedef long pid_t
	upload-pack.c: In function `create_pack_file':
	upload-pack.c:277: warning: int format, pid_t arg (arg 2)
	daemon.c: In function `remove_child':
	daemon.c:371: warning: int format, pid_t arg (arg 2)
	daemon.c: In function `child_handler':
	daemon.c:481: warning: int format, pid_t arg (arg 3)
7) I think these can safely be ignored:
	builtin-help.c: In function `cmd_help':
	builtin-help.c:234: warning: null format string
	builtin-help.c:236: warning: null format string
	git.c: In function `main':
	git.c:280: warning: null format string
I'll send out patches in reply to this mail for 2) and 6)
-- 
Uwe Zeisberger

main(){char*a="main(){char*a=%c%s%c;printf(a,34,a,34%c";printf(a,34,a,34
,10);a=",10);a=%c%s%c;printf(a,34,a,34,10);}%c";printf(a,34,a,34,10);}
Uwe Zeisberger· Jun 26, 2006, 08:23 UTC · re: Uwe Zeisberger · lore

[PATCH] include signal.h for prototype of signal()

Signed-off-by: Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de>
---
 connect.c     |    1 +
 merge-index.c |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
46cd6d04f4531dfaf56f7f1beb4ea6c73f08015e
diff --git a/connect.c b/connect.c
index db7342e..6c5389b 100644
--- a/connect.c
+++ b/connect.c
@@ -3,6 +3,7 @@
 #include "pkt-line.h"
 #include "quote.h"
 #include "refs.h"
+#include <signal.h>
 #include <sys/wait.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
diff --git a/merge-index.c b/merge-index.c
index 190e12f..91908d8 100644
--- a/merge-index.c
+++ b/merge-index.c
@@ -1,3 +1,4 @@
+#include <signal.h>
 #include <sys/types.h>
 #include <sys/wait.h>
 
-- 
1.1.6.g7d80e


-- 
Uwe Zeisberger

http://www.google.com/search?q=the+speed+of+light+in+m%2Fs
Uwe Zeisberger· Jun 26, 2006, 08:51 UTC · re: Uwe Zeisberger · lore

Re: [PATCH] include signal.h for prototype of signal()

Hello, 

Oops, this patch was already posted by Dennis Stosberg in <20060626082613.G7dd5c243@leonov.stosberg.net>. (But it lacks a sign-off, as do his other patches.)

Uwe Zeisberger wrote:
Show 30 quoted lines
> Signed-off-by: Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de>
> 
> ---
> 
>  connect.c     |    1 +
>  merge-index.c |    1 +
>  2 files changed, 2 insertions(+), 0 deletions(-)
> 
> 46cd6d04f4531dfaf56f7f1beb4ea6c73f08015e
> diff --git a/connect.c b/connect.c
> index db7342e..6c5389b 100644
> --- a/connect.c
> +++ b/connect.c
> @@ -3,6 +3,7 @@
>  #include "pkt-line.h"
>  #include "quote.h"
>  #include "refs.h"
> +#include <signal.h>
>  #include <sys/wait.h>
>  #include <sys/socket.h>
>  #include <netinet/in.h>
> diff --git a/merge-index.c b/merge-index.c
> index 190e12f..91908d8 100644
> --- a/merge-index.c
> +++ b/merge-index.c
> @@ -1,3 +1,4 @@
> +#include <signal.h>
>  #include <sys/types.h>
>  #include <sys/wait.h>
>  
-- 
Uwe Zeisberger

cat /*dev/null; echo 'Hello World!';
cat > /dev/null <<*/ 
() { } int main() { printf("Hello World!\n");}
/* */
Uwe Zeisberger· Jun 26, 2006, 08:26 UTC · re: Uwe Zeisberger · lore

[PATCH] cast pid_t to long for printing

This fixes warnings on Solaris 8.
Signed-off-by: Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de>
---

While fixing daemon.c, I saw that there is a call to syslog using %d for pid_t, too. I fixed that in the same way without further testing and manual reading. I assume that's OK.

 daemon.c      |    9 ++++++---
 upload-pack.c |    2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)
b339b05462efea5fee9f2b9bf70de03897a5e4ab
diff --git a/daemon.c b/daemon.c
index 1ba4d66..8641b13 100644
--- a/daemon.c
+++ b/daemon.c
@@ -368,7 +368,7 @@ static void remove_child(pid_t pid, unsi
 		struct child m;
 		deleted = (deleted + 1) % MAX_CHILDREN;
 		if (deleted == spawned)
-			die("could not find dead child %d\n", pid);
+			die("could not find dead child %ld\n", (long)pid);
 		m = live_child[deleted];
 		live_child[deleted] = n;
 		if (m.pid == pid)
@@ -476,9 +476,12 @@ static void child_handler(int signo)
 				if (!WIFEXITED(status) || WEXITSTATUS(status) > 0)
 					dead = " (with error)";
 				if (log_syslog)
-					syslog(LOG_INFO, "[%d] Disconnected%s", pid, dead);
+					syslog(LOG_INFO, "[%ld] Disconnected%s",
+					       (long)pid, dead);
 				else
-					fprintf(stderr, "[%d] Disconnected%s\n", pid, dead);
+					fprintf(stderr,
+						"[%ld] Disconnected%s\n",
+						(long)pid, dead);
 			}
 			continue;
 		}
diff --git a/upload-pack.c b/upload-pack.c
index 7b86f69..fdfef39 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -274,7 +274,7 @@ static void create_pack_file(void)
 					goto fail;
 				}
 				error("git-upload-pack: we weren't "
-				      "waiting for %d", pid);
+				      "waiting for %ld", (long)pid);
 				continue;
 			}
 			if (!WIFEXITED(status) || WEXITSTATUS(status) > 0) {
-- 
1.1.6.g7d80e

-- 
Uwe Zeisberger

exit vi, lesson V:
o : q ! CTRL-V <CR> <Esc> " d d d @ d
Junio C Hamano· Jun 26, 2006, 09:26 UTC · re: Uwe Zeisberger · lore

Re: [PATCH] cast pid_t to long for printing

Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de> writes:
> While fixing daemon.c, I saw that there is a call to syslog using %d for
> pid_t, too.  I fixed that in the same way without further testing and
> manual reading. I assume that's OK.

Is anybody using pid_t that is wider than int? IOW, I wonder if it would make more sense to use "%d" with casting to int.

Uwe Zeisberger· Jun 26, 2006, 12:13 UTC · re: Junio C Hamano · lore

Re: [PATCH] cast pid_t to long for printing

Junio C Hamano wrote:
Show 8 quoted lines
> Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de> writes:
> 
> > While fixing daemon.c, I saw that there is a call to syslog using %d for
> > pid_t, too.  I fixed that in the same way without further testing and
> > manual reading. I assume that's OK.
> 
> Is anybody using pid_t that is wider than int?  IOW, I wonder if
> it would make more sense to use "%d" with casting to int.
See types(3HEAD) e.g. on 
	http://docs.sun.com/app/docs/doc/816-5173/6mbb8ae36?a=view
So it's always as long as int, but it is defined as long...

Best regards Uwe

-- 
Uwe Zeisberger

http://www.google.com/search?q=gravity+on+earth%3D

← back to recent threads