Skip to content

Commit 626870d

Browse files
authored
Merge pull request #582 from biojppm/ci/clang-cl
Fix compilation with clang-cl
2 parents e33054f + afde9fb commit 626870d

6 files changed

Lines changed: 10 additions & 1 deletion

File tree

changelog/current.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## Fixes
22

33
- [PR#580](https://github.com/biojppm/rapidyaml/pull/580): fix compilation error when `RYML_NO_DEFAULT_CALLBACKS` is defined (thanks @toge)
4+
- [PR#582](https://github.com/biojppm/rapidyaml/pull/582): fix compilation with clang-cl
45

56

67
## Python

samples/quickstart.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6436,6 +6436,7 @@ void ErrorHandlerExample::check_disabled() const
64366436
// helper functions for sample_parse_file()
64376437

64386438
C4_SUPPRESS_WARNING_MSVC_WITH_PUSH(4996) // fopen: this function may be unsafe
6439+
C4_SUPPRESS_WARNING_CLANG_WITH_PUSH("-Wdeprecated-declarations") // fopen is deprecated
64396440
/** load a file from disk into an existing CharContainer */
64406441
template<class CharContainer>
64416442
size_t file_get_contents(const char *filename, CharContainer *v)
@@ -6479,6 +6480,7 @@ void file_put_contents(const char *filename, const char *buf, size_t sz, const c
64796480
std::fwrite(buf, 1, sz, fp); // NOLINT
64806481
std::fclose(fp); // NOLINT
64816482
}
6483+
C4_SUPPRESS_WARNING_CLANG_POP
64826484
C4_SUPPRESS_WARNING_MSVC_POP
64836485

64846486
/** @} */ // doc_sample_helpers

test/test_callbacks.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010

1111
C4_SUPPRESS_WARNING_MSVC_WITH_PUSH(4996) // fopen: This function or variable may be unsafe
12+
C4_SUPPRESS_WARNING_CLANG_WITH_PUSH("-Wdeprecated-declarations") // fopen is deprecated
1213

1314
RYML_DEFINE_TEST_MAIN()
1415

@@ -2296,3 +2297,4 @@ Case const* get_case(csubstr)
22962297
} // namespace c4
22972298

22982299
C4_SUPPRESS_WARNING_MSVC_POP
2300+
C4_SUPPRESS_WARNING_CLANG_POP

test/test_emit.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ std::string emit2file(Emit &&fn)
2222
{
2323
SCOPED_TRACE("emit2file");
2424
C4_SUPPRESS_WARNING_MSVC_WITH_PUSH(4996) // fopen unsafe
25+
C4_SUPPRESS_WARNING_CLANG_WITH_PUSH("-Wdeprecated-declarations") // fopen is deprecated
2526
std::string filename = fs::tmpnam<std::string>();
2627
FILE *f = fopen(filename.c_str(), "wb");
2728
C4_CHECK(f != nullptr);
@@ -32,6 +33,7 @@ std::string emit2file(Emit &&fn)
3233
fs::rmfile(filename.c_str());
3334
_c4dbgpf("emit result: [{}]~~~{}~~~", result.size(), to_csubstr(result));
3435
return result;
36+
C4_SUPPRESS_WARNING_CLANG_POP
3537
C4_SUPPRESS_WARNING_MSVC_POP
3638
}
3739

tools/parse_emit.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ void process_file(Args const& args, std::string *contents)
334334
}
335335
else
336336
{
337+
C4_SUPPRESS_WARNING_CLANG_WITH_PUSH("-Wdeprecated-declarations") // fopen is deprecated
337338
FILE *output = fopen(args.output.str, "wb");
338339
if (!output)
339340
_RYML_ERR_BASIC("could not open file: {}", args.output.str);
@@ -345,6 +346,7 @@ void process_file(Args const& args, std::string *contents)
345346
emit_json_docs(tree, output);
346347
}
347348
(void)fclose(output);
349+
C4_SUPPRESS_WARNING_CLANG_POP
348350
}
349351
}
350352
}

0 commit comments

Comments
 (0)