httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy T. Fielding" <field...@kiwi.ics.uci.edu>
Subject Re: cvs commit: apache-2.0/mpm/src/modules/mpm/mpmt_pthread mpmt_pthread.c
Date Sat, 31 Jul 1999 19:23:40 GMT
Ben, you ignorant slut...

>Bearing in mind that the constant FALSE is not defined by C (in other
>words, I meant that NULL is false in a boolean context), you are wrong.

phthht ...  NULL doesn't become false until it is converted to an int
within a boolean context.  (9 - 9) is false by the same logic.  It
evaluates to false, but that doesn't make it equivalent to false
when what we are talking about is code readability.

>NULL is false (lower case used to help make the point that I'm not
>talking about some "false" constant) because if(NULL) fails. The warning
>occurs because in the case in question we were trying to make a boolean
>variable, which you can't do, so we used an integer as a standin, not
>because NULL is not false.
>
>If we had elected to use a pointer as a standin for a boolean, there
>would have been no warning.

That's just because the warning would occur too often, not because it is
somehow the right thing to do.  Implicit type conversion happens.

>> A person who reads code as if pointers are the same as ints just because
>> they have the same machine representation is going to screw up as soon as
>> they get to pointer arithmetic.
>
>This is very true, but since I haven't made that error, hardly relevant.
>
>> I don't care what style you use, so long
>> as you don't teach it to anyone else when I'm in the same room.
>
>Try and stop me, big boy. ;-)
>
>Or, alternatively, lecture me about C style when you've learnt it
>properly.

I usually teach people how to program first.

....Roy

Mime
View raw message