Menu

#50 Fix a clang warning

Unstable (example)
closed-accepted
None
5
2013-06-13
2011-10-17
Anonymous
No

Greetings,

Thank you for your great work
Unfortunately, a new static-code analyzer of clang produces a warning in compiling hunspell as listed below. Is it a typo for 'strlen(keyword) - 1'?

third_party/hunspell/src/hunspell/affixmgr.cxx:3545:65: warning: argument to 'sizeof' in 'strncmp' call is the same expression as the source; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
if (strncmp(piece, keyword, sizeof(keyword)) != 0) {
~~~~~~~ ^~~~~~~

This probably needs to be strlen() – or just normal strcmp().

Regards,

Hironori Bono
E-mail: hbono@chromium.org

Discussion

  • caolan mcnamara

    caolan mcnamara - 2013-06-13
    • status: open --> closed-accepted
    • assigned_to: caolan mcnamara
    • Group: --> Unstable (example)