José Luis García Pallero <jgpallero@xxxxxxxxx> writes: > As a curiosity, gcc 4.5.1 compiled by myself for my ppc debian emits a > warning of the type "conversion to size_t from int may change the > sign" for the code > > size_t var=0; > var = strspn("hello","lo"); > var = (size_t)strspn("hello","lo"); > > where strspn returns a size_t type > (http://linux.die.net/man/3/strspn). The warning appears in both > cases. But the warning only appears with the flag -Wconversion > combined with -O3/-O2 or -O1 optimizations. Apparently, in this > version some warnings depends on the level of optimization. > Attached I send the example files I would guess that on your system strspn is a macro when you compile with optimization. Try using the --save-temps option with -O and look at what your call to strspn turns into. Something in the expanded macro is triggering the warning. Ian