| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Remove forced /Od flag in MSVC Release build. (#5216) Add /wd4702 to disable warning C4702: unreachable code in MSVC Release build. Signed-off-by: Richard Musil <risa2000x@gmail.com> Co-authored-by: Richard Musil <risa2000x@gmail.com> | 2 个月前 | |
:page_facing_up: adjust year (#5044) Signed-off-by: Niels Lohmann <mail@nlohmann.me> | 8 个月前 | |
:page_facing_up: adjust year (#5044) Signed-off-by: Niels Lohmann <mail@nlohmann.me> | 8 个月前 | |
:page_facing_up: adjust year (#5044) Signed-off-by: Niels Lohmann <mail@nlohmann.me> | 8 个月前 | |
:page_facing_up: adjust year (#5044) Signed-off-by: Niels Lohmann <mail@nlohmann.me> | 8 个月前 | |
:page_facing_up: adjust year (#5044) Signed-off-by: Niels Lohmann <mail@nlohmann.me> | 8 个月前 | |
:page_facing_up: adjust year (#5044) Signed-off-by: Niels Lohmann <mail@nlohmann.me> | 8 个月前 | |
:page_facing_up: adjust year (#5044) Signed-off-by: Niels Lohmann <mail@nlohmann.me> | 8 个月前 | |
Fix nvcc CUDA 12.0/12.1 C++20 ranges parse error (#3907) (#5248) * Test ci_cuda_example against a CUDA version matrix at C++20 (#3907) The ci_cuda_example job compiled against the json-ci image's CUDA 11.0 toolkit at cuda_std_11, which cannot exercise #3907 (a c++20 parse error in iteration_proxy.hpp's enable_borrowed_range reported under nvcc). Switch the job to pull official nvidia/cuda devel images directly and matrix across CUDA 11.8-12.6 at cuda_std_20 so CI can empirically confirm which versions are actually affected before any source-level fix is attempted. Signed-off-by: Niels Lohmann <mail@nlohmann.me> * Fix nvcc CUDA 12.0/12.1 C++20 ranges parse error (#3907) The diagnostic matrix in this PR confirmed the affected range exactly: nvcc 12.0.1 and 12.1.1 both fail with "expected initializer before '<' token" on iteration_proxy.hpp's enable_borrowed_range variable template specialization at -std=c++20; 12.2.2 and newer already build cleanly. Guard JSON_HAS_RANGES off for that narrow nvcc version range, matching the existing GCC-11/libstdc++ carve-outs in the same ifdef chain, and regenerate single_include accordingly. Broaden the CUDA smoke test to also exercise comparisons (operator==/operator<=>, gated independently by JSON_HAS_THREE_WAY_COMPARISON) and range-based iteration, not just dump()/erase(), so the fix's actual scope is evidenced by CI rather than assumed from the single reported symptom. Have tests/cuda_example/CMakeLists.txt pick the newest C++ standard the detected nvcc version actually supports (20/17/11) instead of hard-requiring C++20, so older toolkits build at a lower standard instead of failing CMake configure outright. This is test-project-local only; the JSON_HAS_RANGES guard is what protects real client code, since a header can't control what -std= flag it's compiled with. Right-size the CI matrix from the 8-version diagnostic sweep down to 11.8.0 (C++17 fallback path) / 12.1.1 (permanent #3907 regression guard) / 12.6.3 (recent coverage), and update the compiler-version table in the quality assurance docs to match. Signed-off-by: Niels Lohmann <mail@nlohmann.me> * Fix ci_cuda_example CUDA 11.8 build after C++17 fallback (#3907) The 11.8.0 leg's graceful C++17 fallback (added in the previous commit) worked correctly, but the broadened smoke test used the <=> operator unconditionally, which isn't valid syntax pre-C++20 — nvcc rejected it with "expected an expression" once the CMake logic picked cuda_std_17 for the older toolkit. Gate those two lines behind JSON_HAS_THREE_WAY_COMPARISON like the library itself does internally. Sanity-compiled the file as plain C++ at both -std=c++17 (skips the guarded block) and -std=c++20 (includes it) locally; the actual nvcc build is verified via CI on PR #5248. Signed-off-by: Niels Lohmann <mail@nlohmann.me> --------- Signed-off-by: Niels Lohmann <mail@nlohmann.me> | 1 个月前 | |
Add std::format and fmt support (#5224) * :sparkles: add std::format and fmt support Signed-off-by: Niels Lohmann <mail@nlohmann.me> * :recycle: reorganize PR Signed-off-by: Niels Lohmann <mail@nlohmann.me> * :green_heart: fix build Signed-off-by: Niels Lohmann <mail@nlohmann.me> * :green_heart: fix build Signed-off-by: Niels Lohmann <mail@nlohmann.me> * :green_heart: fix build Signed-off-by: Niels Lohmann <mail@nlohmann.me> --------- Signed-off-by: Niels Lohmann <mail@nlohmann.me> | 2 个月前 | |
Extend value to arrays when using JSON pointers (#5223) * :sparkles: extend value to arrays when using JSON pointers Signed-off-by: Niels Lohmann <mail@nlohmann.me> * :green_heart: avoid exceptions Signed-off-by: Niels Lohmann <mail@nlohmann.me> * :green_heart: avoid exceptions Signed-off-by: Niels Lohmann <mail@nlohmann.me> --------- Signed-off-by: Niels Lohmann <mail@nlohmann.me> | 2 个月前 | |
Reorganize directories (#3462) * :truck: move files * :truck: rename doc folder to docs * :truck: rename test folder to tests | 4 年前 | |
Fix update(merge_objects=true) throwing on primitive-to-object merge (#5414) When merge_objects is true, recurse only if the existing value is an object. Otherwise overwrite, matching the documented "all other values are overwritten as usual" behavior. Fixes #5402 Signed-off-by: elix3r <157088510+22elix3r@users.noreply.github.com> | 10 天前 | |
Adjust warnings flags (#4801) * :rotating_light: suppress warnings Signed-off-by: Niels Lohmann <mail@nlohmann.me> * :rotating_light: suppress warnings Signed-off-by: Niels Lohmann <mail@nlohmann.me> * :rotating_light: suppress warnings Signed-off-by: Niels Lohmann <mail@nlohmann.me> * :rotating_light: suppress warnings Signed-off-by: Niels Lohmann <mail@nlohmann.me> * :rotating_light: suppress warnings Signed-off-by: Niels Lohmann <mail@nlohmann.me> * :rotating_light: suppress warnings Signed-off-by: Niels Lohmann <mail@nlohmann.me> --------- Signed-off-by: Niels Lohmann <mail@nlohmann.me> | 1 年前 | |
Fix stale Clang -Weverything suppression comments; drop -Wno-missing-noreturn (#5250) * Fix stale Clang -Weverything suppression comments; eliminate -Wno-missing-noreturn cmake/clang_flags.cmake claimed -Wno-unsafe-buffer-usage was needed only for Doctest and that -Wno-missing-noreturn had "no way to silence... otherwise" (PR #4871, which never actually attempted a source fix). Neither held up under investigation (todo 130): - -Wno-unsafe-buffer-usage is pervasive (208 distinct sites across 19 files measured with clang trunk in silkeh/clang:dev), spanning the library's own low-level numeric/buffer code (to_chars, serializer, lexer, binary reader/writer, input adapters, json_pointer) as well as vendored Doctest itself (96 of the 208 sites). A source-level fix is not feasible at this scale; the comment now says so instead of blaming Doctest alone. - -Wno-missing-noreturn had exactly two real trigger sites, both genuinely and unconditionally non-returning: a test-only throwing allocator (tests/src/unit-allocator.cpp) and, previously undiscovered, wide_string_input_adapter::get_elements<T>() in include/nlohmann/detail/input/input_adapters.hpp. Verified this isn't a wider pattern by checking all 160 JSON_THROW call sites in the library for functions whose entire body is an unconditional throw. Annotated both ([[noreturn]] in the test file, since JSON_HEDLEY_NO_RETURN is #undef'd by the time test code runs; JSON_HEDLEY_NO_RETURN in the library file, its first real use anywhere in the codebase) and dropped the suppression entirely. single_include/nlohmann/json.hpp regenerated via `make amalgamate`; `make check-amalgamation` passes. Verified in Docker (silkeh/clang:dev, matching the ci_static_analysis_clang CI job): baseline builds clean, and the full 194-target test suite builds with zero warnings under the corrected CLANG_CXXFLAGS (-Wno-missing-noreturn no longer in the list). Also sanity-compiled and ran unit-allocator.cpp and unit-wstring.cpp on host Apple Clang to confirm behavior is unchanged. Signed-off-by: Niels Lohmann <mail@nlohmann.me> * Fix MSVC C4702 warning caused by JSON_HEDLEY_NO_RETURN on get_elements() PR #5250 annotated wide_string_input_adapter::get_elements<T>() with JSON_HEDLEY_NO_RETURN (it unconditionally throws). On MSVC this expands to __declspec(noreturn), and MSVC correctly determined that the code following its call in binary_reader.hpp is unreachable for that instantiation, firing C4702 under /W4 /WX in the msvc, msvc-vs2026, and msvc-arm64 Debug jobs. Clang doesn't flag this case, so the Docker verification for #5250 (which only checked Clang -Weverything) didn't catch it. This is the same warning class already tolerated for Release builds since PR #5216, where MSVC's optimizer independently found the same dead code after /Od was removed. Extend that existing /wd4702 suppression to Debug builds too, instead of reverting the noreturn annotation. Signed-off-by: Niels Lohmann <mail@nlohmann.me> --------- Signed-off-by: Niels Lohmann <mail@nlohmann.me> | 1 个月前 | |
Reorganize directories (#3462) * :truck: move files * :truck: rename doc folder to docs * :truck: rename test folder to tests | 4 年前 | |
Document fuzzer usage (#3478) * :memo: document fuzzer usage * :memo: address review comments | 4 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 个月前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 1 个月前 | ||
| 2 个月前 | ||
| 2 个月前 | ||
| 4 年前 | ||
| 10 天前 | ||
| 1 年前 | ||
| 1 个月前 | ||
| 4 年前 | ||
| 4 年前 |