About coverity 440107 (keyimpl.cxx in registry)

Stephan Bergmann sbergman at redhat.com
Sun Mar 24 15:12:44 PDT 2013


On 03/23/2013 01:00 PM, julien2412 wrote:
> If I remove these cases in the switch, I've got this:
> /home/julien/compile-libreoffice/libo/registry/source/keyimpl.cxx: In member
> function ‘RegError ORegKey::getValue(const rtl::OUString&, RegValue) const’:
> /home/julien/compile-libreoffice/libo/registry/source/keyimpl.cxx:622:12:
> error: enumeration value ‘RG_VALUETYPE_LONGLIST’ not handled in switch
> [-Werror=switch]
> /home/julien/compile-libreoffice/libo/registry/source/keyimpl.cxx:622:12:
> error: enumeration value ‘RG_VALUETYPE_STRINGLIST’ not handled in switch
> [-Werror=switch]
> /home/julien/compile-libreoffice/libo/registry/source/keyimpl.cxx:622:12:
> error: enumeration value ‘RG_VALUETYPE_UNICODELIST’ not handled in switch
> [-Werror=switch]

In which case,

> case RG_VALUETYPE_LONGLIST:
> case RG_VALUETYPE_STRINGLIST:
> case RG_VALUETYPE_UNICODELIST:
>     assert(false); // this cannot happen

is the canonic solution.

Stephan


More information about the LibreOffice mailing list