Re: [ntdev] Kernel Debugging over Network

Perhaps Max is pointing out that in C there is no boolean type and only a convention hinged on the language behavior that false is zero and true is nonzero. so testing equality to TRUE is not possible and testing equality to FALSE is perhaps more clearly written in some C styles with the ! Operator. but testing equality to FALSE is the only test that makes sense semantically.

I think Max could have bought a few more words to make this more clear and not have used the confusing term boolean in the context of C.

Dave Cattley

Also remember that this isn’t really even a language feature - its a CPU feature that has a thin mask in C. Conditional branch instructions in all platforms for some decades have behaved this way.

Sent from Surface Pro

From: Maxim S. Shatskih
Sent: ‎Wednesday‎, ‎December‎ ‎03‎, ‎2014 ‎3‎:‎11‎ ‎PM
To: Windows System Software Devs Interest List

value is 0. Replacing (KD_DEBUGGER_NOT_PRESENT == FALSE)
with (!KD_DEBUGGER_NOT_PRESENT) is just stupid.

Imagine other languages then C :slight_smile:

The rule of “never compare booleans, just use them directly in conditions” is going back to Pascal and maybe Algol-68 :slight_smile:


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer