[PHP-DEV] size_t, casting and expression is always true (or false)

2011-02-01 Thread Richard Quadling
Hi. I was looking at the cause for a test failing. It came down to ... size_t n; if (n 0) { // Code never reached as n is unsigned and cannot be negative. } I'm not a strong c developer, but from reading it seems that size_t is always unsigned. Using the windows compiler (and turning on

Re: [PHP-DEV] size_t, casting and expression is always true (or false)

2011-02-01 Thread Richard Quadling
On 1 February 2011 15:07, Andrey Hristov p...@hristov.com wrote:  Hi Richard, On 02/01/2011 02:35 PM, Richard Quadling wrote: Hi. I was looking at the cause for a test failing. It came down to ... size_t n; if (n 0) {  // Code never reached as n is unsigned and cannot be negative. }