aboutsummaryrefslogtreecommitdiff
path: root/examples/main
diff options
context:
space:
mode:
authorBorislav Stanimirov <b.stanimirov@abv.bg>2023-06-16 21:23:53 +0300
committerGitHub <noreply@github.com>2023-06-16 21:23:53 +0300
commit9cbf50c041a525d781c7764f493a5443924e4e38 (patch)
tree73c6331d8f95335616f3a20f71a9ad259431c3b7 /examples/main
parent3d0112261042b356621e93db3fa4c6798a5d098f (diff)
build : fix and ignore MSVC warnings (#1889)
Diffstat (limited to 'examples/main')
-rw-r--r--examples/main/main.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/main/main.cpp b/examples/main/main.cpp
index efa913e..ef9e75f 100644
--- a/examples/main/main.cpp
+++ b/examples/main/main.cpp
@@ -28,6 +28,10 @@
#include <signal.h>
#endif
+#if defined(_MSC_VER)
+#pragma warning(disable: 4244 4267) // possible loss of data
+#endif
+
static console_state con_st;
static llama_context ** g_ctx;
@@ -348,7 +352,7 @@ int main(int argc, char ** argv) {
if ((int)embd.size() > max_embd_size) {
auto skipped_tokens = embd.size() - max_embd_size;
console_set_color(con_st, CONSOLE_COLOR_ERROR);
- printf("<<input too long: skipped %ld token%s>>", skipped_tokens, skipped_tokens != 1 ? "s" : "");
+ printf("<<input too long: skipped %" PRIu64 " token%s>>", skipped_tokens, skipped_tokens != 1 ? "s" : "");
console_set_color(con_st, CONSOLE_COLOR_DEFAULT);
fflush(stdout);
embd.resize(max_embd_size);