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

Marc Lehmann schmorp at schmorp.de
Tue Nov 20 01:56:17 CET 2012


On Mon, Nov 19, 2012 at 10:20:44AM -0800, Colin McCabe <cmccabe at alumni.cmu.edu> wrote:
> You might be able to silence this with __attribute__((unused)), at

is only defined for variables and functions.

> least for GCC and llvm.  Or possibly by making assert a multi-argument
> macro...

macros can't be overloaded, and even if, it would defeat the purpose, as the
message wouldn't be printed.

note that gcc does not output any such warnings by default - you have to
enable them in the first place. libev doesn't normally spit out lots of
warnings, it usually spits out none.

if one gets warnings, then because one chose to get those warnings.
applying these to other people's code might indeed result in lots of
warnings. the best way to get rid of them is to not enable them in the
first place.

slightly offtopic: the worst thing possible is to enable -Werror - whil
warnings themselves can be extremely useful, -Werror in published code
never is, because you don't control the compiler and compiler version that
the other side is using, often making your code not compile on a newer (or
older) compiler

-- 
                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