Task #91465 - fixed.err

back to task #91465
download
Error: COMPILER_WARNING (CWE-1164):
libpinyin-2.10.2/src/lookup/phonetic_lookup.cpp:21: included_from: Included from here.
libpinyin-2.10.2/src/lookup/phonetic_lookup.h:174:13: warning[-Wunused-function]: 'gint pinyin::trellis_value_compare(const trellis_value_t**, const trellis_value_t**)' defined but not used
#  174 | static gint trellis_value_compare(const trellis_value_t ** lhs,
#      |             ^~~~~~~~~~~~~~~~~~~~~
#  172|   }
#  173|   
#  174|-> static gint trellis_value_compare(const trellis_value_t ** lhs,
#  175|                                     const trellis_value_t ** rhs) {
#  176|       /* in descending order */

Error: COMPILER_WARNING (CWE-1164):
libpinyin-2.10.2/src/lookup/phonetic_lookup.cpp:21: included_from: Included from here.
libpinyin-2.10.2/src/lookup/phonetic_lookup.h:174:13: warning[-Wunused-function]: ‘gint pinyin::trellis_value_compare(const trellis_value_t**, const trellis_value_t**)’ defined but not used
#  174 | static gint trellis_value_compare(const trellis_value_t ** lhs,
#      |             ^~~~~~~~~~~~~~~~~~~~~
#  172|   }
#  173|   
#  174|-> static gint trellis_value_compare(const trellis_value_t ** lhs,
#  175|                                     const trellis_value_t ** rhs) {
#  176|       /* in descending order */

Error: COMPILER_WARNING (CWE-195):
libpinyin-2.10.2/src/pinyin.cpp: scope_hint: In function 'bool _prepend_longer_candidates(pinyin_instance_t*, CandidateVector)'
libpinyin-2.10.2/src/pinyin.cpp:1890:23: warning[-Wsign-compare]: comparison of integer expressions of different signedness: 'int' and 'guint' {aka 'unsigned int'}
# 1890 |     for (int i = 0; i < tokenarray->len; ++i) {
#      |                     ~~^~~~~~~~~~~~~~~~~
# 1888|       phrase_token_t longer_token = null_token;
# 1889|       PhraseItem longer_item, item;
# 1890|->     for (int i = 0; i < tokenarray->len; ++i) {
# 1891|           phrase_token_t token = g_array_index(tokenarray, phrase_token_t, i);
# 1892|   

Error: COMPILER_WARNING (CWE-1023):
libpinyin-2.10.2/src/pinyin.cpp: scope_hint: In function 'bool _compute_phrase_length(pinyin_context_t*, CandidateVector)'
libpinyin-2.10.2/src/pinyin.cpp:1965:15: warning[-Wswitch]: enumeration value 'LONGER_CANDIDATE' not handled in switch
# 1965 |         switch(candidate->m_candidate_type) {
#      |               ^
# 1963|               (candidates, lookup_candidate_t, i);
# 1964|   
# 1965|->         switch(candidate->m_candidate_type) {
# 1966|           case NBEST_MATCH_CANDIDATE:
# 1967|               abort();

Error: COMPILER_WARNING (CWE-1023):
libpinyin-2.10.2/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):
libpinyin-2.10.2/src/pinyin.cpp: scope_hint: In function 'bool _compute_predicted_prefix_candidates(pinyin_instance_t*)'
libpinyin-2.10.2/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):
libpinyin-2.10.2/src/pinyin.cpp: scope_hint: In function 'bool pinyin_guess_predicted_candidates(pinyin_instance_t*, const char*)'
libpinyin-2.10.2/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):
libpinyin-2.10.2/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):
libpinyin-2.10.2/src/pinyin.cpp: scope_hint: In function 'bool pinyin_guess_predicted_candidates_with_punctuations(pinyin_instance_t*, const char*)'
libpinyin-2.10.2/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|