------- Comment #2 from pinskia at gcc dot gnu dot org  2006-02-20 17:17 -------
This is really  a glibc bug as far as I can tell.
Lets look into what glibc exands the string functions to:
 i=__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (data) &&
__builtin_constant_p (s) && (__s1_len = strlen (data), __s2_len = strlen (s),
(!((size_t)(const void *)((data) + 1) - (size_t)(const void *)(data) == 1) ||
__s1_len >= 4) && (!((size_t)(const void *)((s) + 1) - (size_t)(const void
*)(s) == 1) || __s2_len >= 4)) ? __builtin_strcmp (data, s) :
(__builtin_constant_p (data) && ((size_t)(const void *)((data) + 1) -
(size_t)(const void *)(data) == 1) && (__s1_len = strlen (data), __s1_len < 4)
? (__builtin_constant_p (s) && ((size_t)(const void *)((s) + 1) -
(size_t)(const void *)(s) == 1) ? __builtin_strcmp (data, s) : (__extension__
({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *)
(s); register int __result = (((__const unsigned char *) (__const char *)
(data))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result =
(((__const unsigned char *) (__const char *) (data))[1] - __s2[1]); if
(__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *)
(__const char *) (data))[2] - __s2[2]); if (__s1_len > 2 && __result == 0)
__result = (((__const unsigned char *) (__const char *) (data))[3] - __s2[3]);
} } __result; }))) : (__builtin_constant_p (s) && ((size_t)(const void *)((s) +
1) - (size_t)(const void *)(s) == 1) && (__s2_len = strlen (s), __s2_len < 4) ?
(__builtin_constant_p (data) && ((size_t)(const void *)((data) + 1) -
(size_t)(const void *)(data) == 1) ? __builtin_strcmp (data, s) :
(__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *)
(__const char *) (data); register int __result = __s1[0] - ((__const unsigned
char *) (__const char *) (s))[0]; if (__s2_len > 0 && __result == 0) { __result
= (__s1[1] - ((__const unsigned char *) (__const char *) (s))[1]); if (__s2_len
> 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *)
(__const char *) (s))[2]); if (__s2_len > 2 && __result == 0) __result =
(__s1[3] - ((__const unsigned char *) (__const char *) (s))[3]); } } __result;
}))) : __builtin_strcmp (data, s)))); });

Yes that mess.

This is not a gcc bug, there is nothing GCC can do better.
Anyways with ppc-darwin, I only get the following warnings (not using the
preprocessed source):
t.c:8: warning: pointer targets in passing argument 1 of 'strcpy' differ in
signedness
t.c:9: warning: pointer targets in passing argument 1 of 'strcmp' differ in
signedness

So this is a bug in the glibc headers which exposed the other warnings.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26383

Reply via email to