Newly introduced findings

List of Findings

Error: COMPILER_WARNING (CWE-1023): [#def1]
libpinyin-2.9.92-build/libpinyin-2.9.92/src/pinyin.cpp:1965:15: warning[-Wswitch]: enumeration value 'PREDICTED_PUNCTUATION_CANDIDATE' not handled in switch
# 1963|               (candidates, lookup_candidate_t, i);
# 1964|   
# 1965|->         switch(candidate->m_candidate_type) {
# 1966|           case NBEST_MATCH_CANDIDATE:
# 1967|               abort();

Error: COMPILER_WARNING (CWE-563): [#def2]
libpinyin-2.9.92-build/libpinyin-2.9.92/src/pinyin.cpp: scope_hint: In function 'bool _compute_predicted_prefix_candidates(pinyin_instance_t*)'
libpinyin-2.9.92-build/libpinyin-2.9.92/src/pinyin.cpp:2373:17: warning[-Wunused-variable]: unused variable 'prefixes'
# 2373 |     TokenVector prefixes = instance->m_prefixes;
#      |                 ^~~~~~~~
# 2371|       FacadePhraseIndex * phrase_index = context->m_phrase_index;
# 2372|       CandidateVector candidates = instance->m_candidates;
# 2373|->     TokenVector prefixes = instance->m_prefixes;
# 2374|   
# 2375|       /* search prefix candidate. */

Error: COMPILER_WARNING (CWE-563): [#def3]
libpinyin-2.9.92-build/libpinyin-2.9.92/src/pinyin.cpp: scope_hint: In function 'bool pinyin_guess_predicted_candidates(pinyin_instance_t*, const char*)'
libpinyin-2.9.92-build/libpinyin-2.9.92/src/pinyin.cpp:2413:25: warning[-Wunused-variable]: unused variable 'phrase_index'
# 2413 |     FacadePhraseIndex * phrase_index = context->m_phrase_index;
#      |                         ^~~~~~~~~~~~
# 2411|                                          const char * prefix) {
# 2412|       pinyin_context_t * context = instance->m_context;
# 2413|->     FacadePhraseIndex * phrase_index = context->m_phrase_index;
# 2414|       CandidateVector candidates = instance->m_candidates;
# 2415|       TokenVector prefixes = instance->m_prefixes;

Error: COMPILER_WARNING (CWE-563): [#def4]
libpinyin-2.9.92-build/libpinyin-2.9.92/src/pinyin.cpp:2460:25: warning[-Wunused-variable]: unused variable 'phrase_index'
# 2460 |     FacadePhraseIndex * phrase_index = context->m_phrase_index;
#      |                         ^~~~~~~~~~~~
# 2458|   
# 2459|       pinyin_context_t * context = instance->m_context;
# 2460|->     FacadePhraseIndex * phrase_index = context->m_phrase_index;
# 2461|       CandidateVector candidates = instance->m_candidates;
# 2462|       TokenVector prefixes = instance->m_prefixes;

Error: COMPILER_WARNING (CWE-195): [#def5]
libpinyin-2.9.92-build/libpinyin-2.9.92/src/pinyin.cpp: scope_hint: In function 'bool pinyin_guess_predicted_candidates_with_punctuations(pinyin_instance_t*, const char*)'
libpinyin-2.9.92-build/libpinyin-2.9.92/src/pinyin.cpp:2468:32: warning[-Wsign-compare]: comparison of integer expressions of different signedness: 'gint' {aka 'int'} and 'guint' {aka 'unsigned int'}
# 2468 |     for (gint index = 0; index < prefixes->len; ++index) {
#      |                          ~~~~~~^~~~~~~~~~~~~~~
# 2466|       /* prepend the punctuations */
# 2467|       GArray * punct_array = g_array_new(TRUE, TRUE, sizeof(gchar *));
# 2468|->     for (gint index = 0; index < prefixes->len; ++index) {
# 2469|           prev_token = g_array_index(prefixes, phrase_token_t, index);
# 2470|   

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.82.0
diffbase-analyzer-version-cppcheck2.16.0
diffbase-analyzer-version-gcc14.2.1
diffbase-analyzer-version-gcc-analyzer15.0.0
diffbase-analyzer-version-shellcheck0.10.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-243.us-west-2.compute.internal
diffbase-mock-configfedora-rawhide-gcc-latest-x86_64
diffbase-project-namelibpinyin-2.9.91-1.fc41
diffbase-store-results-to/tmp/tmp0vkc8wqx/libpinyin-2.9.91-1.fc41.tar.xz
diffbase-time-created2024-11-13 01:38:46
diffbase-time-finished2024-11-13 01:42:30
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmp0vkc8wqx/libpinyin-2.9.91-1.fc41.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmp0vkc8wqx/libpinyin-2.9.91-1.fc41.src.rpm'
diffbase-tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-243.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namelibpinyin-2.9.92-1.fc42
store-results-to/tmp/tmp3q9j5c6d/libpinyin-2.9.92-1.fc42.tar.xz
time-created2024-11-13 01:42:52
time-finished2024-11-13 01:46:18
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmp3q9j5c6d/libpinyin-2.9.92-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmp3q9j5c6d/libpinyin-2.9.92-1.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9