[Bug c/53277] Warning using -Wconversion and -Ox in gcc 4.5, 4.6 and 4.7 but not in previous releases
glisse at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed May 9 12:07:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53277
Marc Glisse <glisse at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |glisse at gcc dot gnu.org
--- Comment #9 from Marc Glisse <glisse at gcc dot gnu.org> 2012-05-09 11:50:09 UTC ---
glibc still has:
# define strspn(s, accept) \
__extension__ \
({ char __a0, __a1, __a2; \
(__builtin_constant_p (accept) && __string2_1bptr_p (accept) \
? ((__builtin_constant_p (s) && __string2_1bptr_p (s)) \
? __builtin_strspn (s, accept) \
: ((__a0 = ((const char *) (accept))[0], __a0 == '\0') \
? ((void) (s), 0) \
: ((__a1 = ((const char *) (accept))[1], __a1 == '\0') \
? __strspn_c1 (s, __a0) \
: ((__a2 = ((const char *) (accept))[2], __a2 == '\0') \
? __strspn_c2 (s, __a0, __a1) \
: (((const char *) (accept))[3] == '\0' \
? __strspn_c3 (s, __a0, __a1, __a2) \
: __builtin_strspn (s, accept)))))) \
: __builtin_strspn (s, accept)); })
The lone 0 in the middle should be explicitly cast to size_t, like it is for
fread_unlocked. Could you report it to glibc please?
gcc could avoid this warning when converting a constant, I am pretty sure the
same issue (possibly with another macro) already led to such a conversation...
More information about the Gcc-bugs
mailing list