bnosac / doc2vec

Distributed Representations of Sentences and Documents
Other
46 stars 5 forks source link

fix variable-length arrays #7

Closed jwijffels closed 3 years ago

jwijffels commented 3 years ago
rcpp_doc2vec.cpp: In function ‘Rcpp::DataFrame paragraph2vec_nearest(SEXP, std::string, std::size_t, std::string)’:
rcpp_doc2vec.cpp:96:14: warning: ISO C++ forbids variable length array ‘knn_items’ [-Wvla]
   96 |   knn_item_t knn_items[top_n];
      |              ^~~~~~~~~
rcpp_doc2vec.cpp: In function ‘Rcpp::List paragraph2vec_nearest_sentence(SEXP, Rcpp::List, std::size_t)’:
rcpp_doc2vec.cpp:148:16: warning: ISO C++ forbids variable length array ‘knn_items’ [-Wvla]
  148 |     knn_item_t knn_items[top_n];
      |                ^~~~~~~~~
jwijffels commented 3 years ago

Fixed in pull request https://github.com/bnosac/doc2vec/pull/9

jwijffels commented 3 years ago

Fixed in https://github.com/bnosac/doc2vec/commit/7bdcb7638f77252e41f260c98e1850f6c29f5426