why( warning: left-hand operand of comma expression has no effect)

Marc Lehmann schmorp at schmorp.de
Tue Nov 20 02:32:15 CET 2012


On Tue, Nov 20, 2012 at 01:16:04AM +0000, Sam Bobroff <sbobroff at shoretel.com> wrote:
> Maybe those hack strings should removed from the assert calls and be
> moved into comments in the code?

Calling this a "hack" just shows your immaturity in the C language - not
everything that is new to you is badly done.

This use of assert is part of the C language that is well supported and in
very common use for a long time now, and does what it is suppsoed to do
very well and reliably. It's the only way to reliably achieve the effect
libev needs.

Putting error messages into a comment would completely defeat the purpose
of having runtime error messages in the first place, namely telling whats
wrong at *runtime*, when the comment is long gone.

If you are worried about runtime error messages, you can compile with
-DNDEBUG to get rid of them (and any warnings that might have been
enabled).

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp at schmorp.de
      -=====/_/_//_/\_,_/ /_/\_\



More information about the libev mailing list