[cfe-dev] clang: good catch...

Fons Rademakers Fons.Rademakers at cern.ch
Fri Oct 22 12:23:06 PDT 2010


Hi,

  here a nice catch made by clang in out code:

x.cxx:226:19: warning: expression result unused
if (ref||!TFile::Open("file.root"),"CACHEREAD") {

only clang found this, not a single other compiler are other static 
analyzers (and we use most compilers available in the world)!!

The correct code is:

if (ref||!TFile::Open("file.root","CACHEREAD")) {

Cheers, Fons.

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers at cern.ch              Phone: +41 22 7679248
WWW:    http://fons.rademakers.org           Fax:   +41 22 7669640



More information about the cfe-dev mailing list