From patchwork Sat Dec 20 03:46:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chris Metcalf X-Patchwork-Id: 4384 Received: (qmail 7157 invoked by alias); 20 Dec 2014 03:55:48 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 7146 invoked by uid 89); 20 Dec 2014 03:55:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_00, NO_DNS_FOR_FROM, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: gx-1.internal.tilera.com Message-Id: <201412200355.sBK3tckK017881@gx-1.internal.tilera.com> From: Chris Metcalf Date: Fri, 19 Dec 2014 22:46:52 -0500 Subject: [COMMITTED] tilegx: fix strstr to build and link better To: libc-alpha@sourceware.org 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(). --- ChangeLog | 5 +++++ sysdeps/tile/tilegx/strstr.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4c8bcb4..68a8531 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-12-19 Chris Metcalf + + * sysdeps/tile/tilegx/strstr.c (STRSTR): Call __strnlen, not + strnlen. + 2014-12-19 Ondřej Bílka * string/strncat.c (STRNCAT): Simplify implementation. diff --git a/sysdeps/tile/tilegx/strstr.c b/sysdeps/tile/tilegx/strstr.c index 3e72789..d04f129 100644 --- a/sysdeps/tile/tilegx/strstr.c +++ b/sysdeps/tile/tilegx/strstr.c @@ -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 @@ -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