Skip to content

Commit

Permalink
tilegx: fix strstr to build and link better
Browse files Browse the repository at this point in the history
The two_way_short_needle() routine included from str-two-way.h
is not used, so mark it so to avoid compiler warnings.

Calling strnlen() breaks linknamespace tests, so change it
to __strnlen().
  • Loading branch information
Chris Metcalf committed Dec 20, 2014
1 parent 0c73b4e commit 95dee05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2014-12-19 Chris Metcalf <cmetcalf@ezchip.com>

* sysdeps/tile/tilegx/strstr.c (STRSTR): Call __strnlen, not
strnlen.

2014-12-19 Ondřej Bílka <neleai@seznam.cz>

* string/strncat.c (STRNCAT): Simplify implementation.
Expand Down
3 changes: 2 additions & 1 deletion sysdeps/tile/tilegx/strstr.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
(!memchr ((h) + (h_l), '\0', (j) + (n_l) - (h_l)) \
&& ((h_l) = (j) + (n_l)))
#include "str-two-way.h"
typeof(two_way_short_needle) two_way_short_needle __attribute__((unused));

#undef strstr

Expand Down Expand Up @@ -238,7 +239,7 @@ STRSTR (const char *haystack_start, const char *needle_start)
}

/* Fail if NEEDLE is longer than HAYSTACK. */
if (strnlen (haystack, needle_len) < needle_len)
if (__strnlen (haystack, needle_len) < needle_len)
return NULL;

/* Perform the search. Abstract memory is considered to be an array
Expand Down

0 comments on commit 95dee05

Please sign in to comment.