comparison of unsigned type with signed type

c

Solution

IMO, the compiler is weak or at least pedantic. To quiet this unneeded warning, use:

while (taille > 0u) 

BTW: Love the "Two solutions: 1. 2. and 3."

Late credit: Now see @Wintermute commented similarly on this earlier than myself.

Problem

My compiler (DSP SHARC) is very picky. When I build with remarks I get this error: ``` [cc1123] foo.c:1511 {D} remark: comparison of unsigned type with signed type while (taille > 0) ``` Two solutions: The compiler is right and I should write ``` size_t taille; ... while(taille > (size_t)0) ``` The compiler is stupid and I should ignore this remark Another solution that may involve ISO or MISRA standards What should I do with this remark? EDIT Actually I might better write this example like ``` while(taille) {...} ``` But, this is not related to my initial question

Original source