shogo82148 / mecab

Unofficial fork of taku910/mecab (Yet another Japanese morphological analyzer)
https://shogo82148.github.io/mecab/
8 stars 1 forks source link

fix: warning: 'void* memset(void*, int, size_t)' clearing an object o… #35

Closed shogo82148 closed 4 years ago

shogo82148 commented 4 years ago

…f non-trivial type 'struct MeCab::CharInfo'

shogo82148 commented 4 years ago

warning message is here https://github.com/shogo82148/mecab/runs/444773225?check_suite_focus=true#step:8:45

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DDIC_VERSION=102 "-DMECAB_DEFAULT_RC=\"c:\\\\Program Files\\\\mecab\\\\etc\\\\mecabrc\"" -O3 -Wall -municode -DUNICODE -D_UNICODE -DDLL_EXPORT -c char_property.cpp -o char_property.o
char_property.cpp: In static member function 'static bool MeCab::CharProperty::compile(const char*, const char*, const char*)':
char_property.cpp:194:35: warning: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct MeCab::CharInfo'; use assignment or value-initialization instead [-Wclass-memaccess]
  194 |       std::memset(&c, 0, sizeof(c));
      |                                   ^
In file included from char_property.cpp:11:
char_property.h:16:8: note: 'struct MeCab::CharInfo' declared here
   16 | struct CharInfo {
      |        ^~~~~~~~
shogo82148 commented 4 years ago

LGTM https://github.com/shogo82148/mecab/runs/451024649?check_suite_focus=true