--
[ Picked text/plain from multipart/alternative ]

At 06:01 PM 6/8/2003 -0400, you wrote:

>On Sat, Jun 07, 2003 at 12:22:19PM -0700, James Couzens wrote:
>
>> Why does this logic crash a linux dedicated server?
>>
>
>I'm assuming you're using MSVC on windows.

I'm not quite sure that's a safe assumption.


>  If so, MSVC does not
>evaluate boolean expressions according to the ANSI standard. The correct
>way to do what you want is:
>
>if( (!pPlayer) || !pPlayer -> IsNetClient())

This is blatantly not true. I just checked it. Cmon, do you really think MSVC would 
have screwed up the PRECEDENCE rules?

        CBP* pPlayer = NULL;

        if( !pPlayer || !pPlayer->IsNetClient() )
        {
                printf( "MS can write a compiler!\n" );
        }

Compiles and prints out the statement, as it should.

I'd say the most likely explanation is indeed shimms' and hofer's conjecture, i.e., 
that it has not been initialized. There is no serious compiler that will not follow 
the left-to-right rule, that's a fairly integral part of the C++ specification, which 
is used a lot (it's used throughout the HL SDK, for example), and certainly they all 
follow the correct precedence rules.

Persuter
--

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to