Weird code found by clang

Niko Rönkkö ronkko at iki.fi
Thu Mar 1 14:03:09 PST 2012


On 1.3.2012 23.13, Tor Lillqvist wrote:
 > svtools/source/dialogs/addresstemplate.cxx:195:23: error:
 > self-comparison always evaluates to false
 > [-Werror,-Wtautological-compare]
 >          for (;pFields != pFields; ++pFields)
 >                        ^
 > What should this be? Or is what it currently does, exit the loop after
 > one pass through, actually what's wanted?

Probably it should be pFields != pFieldsEnd ? See original commit:
http://opengrok.libreoffice.org/xref/core/svtools/source/dialogs/addresstemplate.cxx?a=true&r=447a63cfb6d6d3dff63af72490a4c0b96295db6d#250

-- 
RN


More information about the LibreOffice mailing list