ollama-hpp icon indicating copy to clipboard operation
ollama-hpp copied to clipboard

Compile time warnings.

Open briefnotion opened this issue 4 months ago • 0 comments

Thoroughly enjoying the Ollama.hpp. I am new to the AI and Language models and learning, and trying it out. Thank you.   Typically, I compile with warnings treated as errors, and I catch simple mistakes with a cmake entry like:

if(BUILD_STRICT)
  # Strict
  if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
    target_compile_options(chatapi PRIVATE -Wall -Wextra -Werror)
  elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
    target_compile_options(chatapi PRIVATE -Weverything -Werror)
  endif()
else()
  # Not Strict
  if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
    target_compile_options(chatapi PRIVATE -Wall -Wextra)
  elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
    target_compile_options(chatapi PRIVATE -Weverything)
  endif()
endif()

But I do get plenty of warings, shuch as:

/home/briefn/source/ollama_chat/source/../../ollama-hpp/include/ollama.hpp: In constructor 'ollama::image::image(std::string, bool)':
/home/briefn/source/ollama_chat/source/../../ollama-hpp/include/ollama.hpp:102:59: warning: unused parameter 'valid' [-Wunused-parameter]
  102 |             image(const std::string base64_sequence, bool valid = true)
      |                                                      ~~~~~^~~~~~~~~~~~
/home/briefn/source/ollama_chat/source/../../ollama-hpp/include/ollama.hpp: In constructor 'ollama::request::request(const std::string&, const ollama::messages&, const ollama::json&, bool, const std::string&, const std::string&)':
/home/briefn/source/ollama_chat/source/../../ollama-hpp/include/ollama.hpp:250:148: warning: unused parameter 'format' [-Wunused-parameter]
  250 |             request(const std::string& model, const ollama::messages& messages, const json& options=nullptr, bool stream=false, const std::string& format="json", const std::string& keep_alive_duration="5m"): request()
      |                                                                                                                                 ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/briefn/source/ollama_chat/source/../../ollama-hpp/include/ollama.hpp: At global scope:
/home/briefn/source/ollama_chat/source/../../ollama-hpp/include/ollama.hpp:332:13: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
  332 |             const bool has_error() const
      |             ^~~~

Any plans in the future to remove the unused variables so that I can put "strict" mode on? Or, should I compile another way?

briefnotion avatar Oct 14 '24 06:10 briefnotion