summaryrefslogtreecommitdiff
path: root/examples/common.cpp
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/common.cpp
parent3d0112261042b356621e93db3fa4c6798a5d098f (diff)
build : fix and ignore MSVC warnings (#1889)
Diffstat (limited to 'examples/common.cpp')
-rw-r--r--examples/common.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/common.cpp b/examples/common.cpp
index b47f0627..055383be 100644
--- a/examples/common.cpp
+++ b/examples/common.cpp
@@ -28,6 +28,10 @@
#include <wchar.h>
#endif
+#if defined(_MSC_VER)
+#pragma warning(disable: 4244 4267) // possible loss of data
+#endif
+
int32_t get_num_physical_cores() {
#ifdef __linux__
// enumerate the set of thread siblings, num entries is num cores
@@ -373,7 +377,7 @@ bool gpt_params_parse(int argc, char ** argv, gpt_params & params) {
} else {
throw std::exception();
}
- } catch (const std::exception &e) {
+ } catch (const std::exception&) {
invalid_param = true;
break;
}