public inbox for
 help / color / mirror / Atom feed
From: Martin Schwidefsky <>
To: Glibc hackers <>
Subject: [PATCH] string inlines on s390-{32,64}
Date: Thu, 22 Nov 2007 16:43:00 -0000	[thread overview]
Message-ID: <1195749828.31434.0.camel@localhost> (raw)

one of the reasons why the current CVS doesn't compile on s390-{32,64}
is because of conflicting definitions for strlen, strcpy, strncpy, strcat
and strncat e.g. for compiling debug/warning-nop.c. On x86 this doesn't
seem to happen because the five function are defined as macros. The
easiest way to fix this on s390 is to define these five functions as
macros as well.

blue skies,

"Reality continues to ruin my life." - Calvin.

2007-11-22  Martin Schwidefsky  <>

	* sysdeps/s390/bits/string.h (strlen, strcpy, strncpy, strcat,
	strncat): Define as macros to avoid compile errors.

diff -urpN libc/sysdeps/s390/bits/string.h libc-s390/sysdeps/s390/bits/string.h
--- libc/sysdeps/s390/bits/string.h	2007-09-19 13:55:13.000000000 +0200
+++ libc-s390/sysdeps/s390/bits/string.h	2007-11-22 13:32:32.000000000 +0100
@@ -40,8 +40,10 @@
 #define _HAVE_STRING_ARCH_strlen 1
+#define strlen(str) __strlen_g ((str))
-strlen (__const char *__str)
+__strlen_g (__const char *__str)
     char *__ptr, *__tmp;
@@ -59,8 +61,10 @@ strlen (__const char *__str)
 /* Copy SRC to DEST.  */
 #define _HAVE_STRING_ARCH_strcpy 1
+#define strcpy(dest, src) __strcpy_g ((dest), (src))
-strcpy (char *__dest, __const char *__src)
+__strcpy_g (char *__dest, __const char *__src)
     char *tmp = __dest;
@@ -75,8 +79,10 @@ strcpy (char *__dest, __const char *__sr
 #define _HAVE_STRING_ARCH_strncpy 1
+#define strncpy(dest, src, n) __strncpy_g ((dest), (src), (n))
-strncpy (char *__dest, __const char *__src, size_t __n)
+__strncpy_g (char *__dest, __const char *__src, size_t __n)
     char *__ret = __dest;
     char *__ptr;
@@ -114,8 +120,10 @@ strncpy (char *__dest, __const char *__s
 /* Append SRC onto DEST.  */
 #define _HAVE_STRING_ARCH_strcat 1
+#define strcat(dest, src) __strcat_g ((dest), (src))
-strcat(char *__dest, const char *__src)
+__strcat_g(char *__dest, const char *__src)
     char *__ret = __dest;
     char *__ptr, *__tmp;
@@ -142,8 +150,10 @@ strcat(char *__dest, const char *__src)
 /* Append no more than N characters from SRC onto DEST.  */
 #define _HAVE_STRING_ARCH_strncat 1
+#define strncat(dest, src, n) __strncat_g ((dest), (src), (n))
-strncat (char *__dest, __const char *__src, size_t __n)
+__strncat_g (char *__dest, __const char *__src, size_t __n)
     char *__ret = __dest;
     char *__ptr, *__tmp;

             reply	other threads:[~2007-11-22 16:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-22 16:43 Martin Schwidefsky [this message]
2007-12-12 13:13 ` [PATCH] fix string inlines on s390-{32,64} and i486+ Jakub Jelinek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1195749828.31434.0.camel@localhost \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).