threads / patch / 3790

patchSolaris needs strings.h when using index().

Subject: [PATCH] Solaris needs strings.h when using index().

## tl;dr

3 messages between Apr 4, 2006 and Apr 4, 2006. Diffs are folded; open one to read it.

replies: 2people: 3as markdown or json

Peter Eriksen· Apr 4, 2006, 12:36 UTC · lore
From: Peter Eriksen <s022018@student.dtu.dk>
Date: Tue Apr 4 14:33:14 2006 +0200
Subject: [PATCH] Solaris needs strings.h when using index().
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
---
 blame.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
832067e6e16ae6c1ac3bd043ddeb56daa993e682
Show changes to blame.c +1 −0
diff --git a/blame.c b/blame.c
index 396defc..1a08434 100644
--- a/blame.c
+++ b/blame.c
@@ -6,6 +6,7 @@ #include <assert.h>
 #include <time.h>
 #include <sys/time.h>
 #include <math.h>
+#include <strings.h>
 
 #include "cache.h"
 #include "refs.h"
-- 
1.3.0.rc1.gfc99-dirty
Junio C Hamano· Apr 4, 2006, 18:18 UTC · re: Peter Eriksen · lore

Re: [PATCH] Solaris needs strings.h when using index().

"Peter Eriksen" <s022018@student.dtu.dk> writes:
Show 5 quoted lines
> From: Peter Eriksen <s022018@student.dtu.dk>
> Date: Tue Apr 4 14:33:14 2006 +0200
> Subject: [PATCH] Solaris needs strings.h when using index().
>
> Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>

I think somebody else noticed this the other day but I'm undecided if it is easier to replace use of index with strchr, since we include <string.h> and use strchr() everywhere.

H. Peter Anvin· Apr 4, 2006, 18:44 UTC · re: Junio C Hamano · lore

Re: [PATCH] Solaris needs strings.h when using index().

Junio C Hamano wrote:
Show 12 quoted lines
> "Peter Eriksen" <s022018@student.dtu.dk> writes:
> 
>> From: Peter Eriksen <s022018@student.dtu.dk>
>> Date: Tue Apr 4 14:33:14 2006 +0200
>> Subject: [PATCH] Solaris needs strings.h when using index().
>>
>> Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
> 
> I think somebody else noticed this the other day but I'm
> undecided if it is easier to replace use of index with strchr,
> since we include <string.h> and use strchr() everywhere.
> 

strchr() is definitely more portable. The further away you get from BSD heritage, the less likely it is that you're going to see bzero, index, et al whereas anything even remotely modern has memset, strchr, etc.

	-hpa

← back to recent threads