mirror of
https://github.com/nlohmann/json.git
synced 2026-11-20 18:16:53 +00:00
deploy: 4d46bce4e1
This commit is contained in:
1 parent
0c49bb37a5
commit
2aaa1d24ef
346 files changed
+1687
-1033
No files matched your search
@@ -1,8 +1,7 @@
|
||||
<!doctype html><html lang=en class=no-js> <head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=author content="Niels Lohmann"><link href="https://json.nlohmann.me/community/quality_assurance/" rel="canonical"><link href=../contribution_guidelines/ rel=prev><link href=../governance/ rel=next><link rel=icon href=../../assets/images/favicon.png><meta name=generator content="mkdocs-1.6.1, mkdocs-material-9.7.7"><title>Quality assurance - JSON for Modern C++</title><link rel=stylesheet href=../../assets/stylesheets/main.ec1eaa64.min.css><link rel=stylesheet href=../../assets/stylesheets/palette.ab4e12ef.min.css><link rel="stylesheet" href="../../assets/external/fonts.googleapis.com/css.61a430c9.css"><style>:root{--md-text-font:"Roboto";--md-code-font:"JetBrains Mono"}</style><link rel=stylesheet href=../../css/custom.css><script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script></head> <body dir=ltr data-md-color-scheme=default data-md-color-primary=indigo data-md-color-accent=indigo> <input class=md-toggle data-md-toggle=drawer type=checkbox id=__drawer autocomplete=off> <input class=md-toggle data-md-toggle=search type=checkbox id=__search autocomplete=off> <label class=md-overlay for=__drawer></label> <div data-md-component=skip> <a href=#quality-assurance class=md-skip> Skip to content </a> </div> <div data-md-component=announce> </div> <header class=md-header data-md-component=header> <nav class="md-header__inner md-grid" aria-label=Header> <a href=../.. title="JSON for Modern C++" class="md-header__button md-logo" aria-label="JSON for Modern C++" data-md-component=logo> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg> </a> <label class="md-header__button md-icon" for=__drawer> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg> </label> <div class=md-header__title data-md-component=header-title> <div class=md-header__ellipsis> <div class=md-header__topic> <span class=md-ellipsis> JSON for Modern C++ </span> </div> <div class=md-header__topic data-md-component=header-topic> <span class=md-ellipsis> Quality assurance </span> </div> </div> </div> <form class=md-header__option data-md-component=palette> <input class=md-option data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme=default data-md-color-primary=indigo data-md-color-accent=indigo aria-label="Switch to dark mode" type=radio name=__palette id=__palette_0> <label class="md-header__button md-icon" title="Switch to dark mode" for=__palette_1 hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M12 8a4 4 0 0 0-4 4 4 4 0 0 0 4 4 4 4 0 0 0 4-4 4 4 0 0 0-4-4m0 10a6 6 0 0 1-6-6 6 6 0 0 1 6-6 6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12z"/></svg> </label> <input class=md-option data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme=slate data-md-color-primary=indigo data-md-color-accent=indigo aria-label="Switch to light mode" type=radio name=__palette id=__palette_1> <label class="md-header__button md-icon" title="Switch to light mode" for=__palette_0 hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M12 18c-.89 0-1.74-.2-2.5-.55C11.56 16.5 13 14.42 13 12s-1.44-4.5-3.5-5.45C10.26 6.2 11.11 6 12 6a6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12z"/></svg> </label> </form> <script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script> <label class="md-header__button md-icon" for=__search> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 Line truncated
|
||||
<!doctype html><html lang=en class=no-js> <head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=author content="Niels Lohmann"><link href="https://json.nlohmann.me/community/quality_assurance/" rel="canonical"><link href=../contribution_guidelines/ rel=prev><link href=../governance/ rel=next><link rel=icon href=../../assets/images/favicon.png><meta name=generator content="mkdocs-1.6.1, mkdocs-material-9.7.7"><title>Quality assurance - JSON for Modern C++</title><link rel=stylesheet href=../../assets/stylesheets/main.ec1eaa64.min.css><link rel=stylesheet href=../../assets/stylesheets/palette.ab4e12ef.min.css><link rel="stylesheet" href="../../assets/external/fonts.googleapis.com/css.61a430c9.css"><style>:root{--md-text-font:"Roboto";--md-code-font:"JetBrains Mono"}</style><link rel=stylesheet href=../../css/custom.css><script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script></head> <body dir=ltr data-md-color-scheme=default data-md-color-primary=indigo data-md-color-accent=indigo> <input class=md-toggle data-md-toggle=drawer type=checkbox id=__drawer autocomplete=off> <input class=md-toggle data-md-toggle=search type=checkbox id=__search autocomplete=off> <label class=md-overlay for=__drawer></label> <div data-md-component=skip> <a href=#quality-assurance class=md-skip> Skip to content </a> </div> <div data-md-component=announce> </div> <header class=md-header data-md-component=header> <nav class="md-header__inner md-grid" aria-label=Header> <a href=../.. title="JSON for Modern C++" class="md-header__button md-logo" aria-label="JSON for Modern C++" data-md-component=logo> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg> </a> <label class="md-header__button md-icon" for=__drawer> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg> </label> <div class=md-header__title data-md-component=header-title> <div class=md-header__ellipsis> <div class=md-header__topic> <span class=md-ellipsis> JSON for Modern C++ </span> </div> <div class=md-header__topic data-md-component=header-topic> <span class=md-ellipsis> Quality assurance </span> </div> </div> </div> <form class=md-header__option data-md-component=palette> <input class=md-option data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme=default data-md-color-primary=indigo data-md-color-accent=indigo aria-label="Switch to dark mode" type=radio name=__palette id=__palette_0> <label class="md-header__button md-icon" title="Switch to dark mode" for=__palette_1 hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M12 8a4 4 0 0 0-4 4 4 4 0 0 0 4 4 4 4 0 0 0 4-4 4 4 0 0 0-4-4m0 10a6 6 0 0 1-6-6 6 6 0 0 1 6-6 6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12z"/></svg> </label> <input class=md-option data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme=slate data-md-color-primary=indigo data-md-color-accent=indigo aria-label="Switch to light mode" type=radio name=__palette id=__palette_1> <label class="md-header__button md-icon" title="Switch to light mode" for=__palette_0 hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M12 18c-.89 0-1.74-.2-2.5-.55C11.56 16.5 13 14.42 13 12s-1.44-4.5-3.5-5.45C10.26 6.2 11.11 6 12 6a6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12z"/></svg> </label> </form> <script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script> <label class="md-header__button md-icon" for=__search> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 Line truncated
|
||||
<span class=c># -Wno-c++98-compat The library targets C++11.</span>
|
||||
<span class=c># -Wno-c++98-compat-pedantic The library targets C++11.</span>
|
||||
<span class=c># -Wno-deprecated-declarations The library contains annotations for deprecated functions.</span>
|
||||
<span class=c># -Wno-extra-semi-stmt The library uses assert which triggers this warning.</span>
|
||||
<span class=c># -Wno-padded We do not care about padding warnings.</span>
|
||||
<span class=c># -Wno-covered-switch-default All switches list all cases and a default case.</span>
|
||||
<span class=c># -Wno-c2y-extensions Clang 22.1 diagnoses __COUNTER__ as a C2y extension, also in</span>
|
||||
@@ -20,13 +19,12 @@
|
||||
<span class=w> </span><span class=s>-Wno-c++98-compat</span>
|
||||
<span class=w> </span><span class=s>-Wno-c++98-compat-pedantic</span>
|
||||
<span class=w> </span><span class=s>-Wno-deprecated-declarations</span>
|
||||
<span class=w> </span><span class=s>-Wno-extra-semi-stmt</span>
|
||||
<span class=w> </span><span class=s>-Wno-padded</span>
|
||||
<span class=w> </span><span class=s>-Wno-covered-switch-default</span>
|
||||
<span class=w> </span><span class=s>-Wno-c2y-extensions</span>
|
||||
<span class=w> </span><span class=s>-Wno-unsafe-buffer-usage</span>
|
||||
<span class=p>)</span>
|
||||
</code></pre></div> </details> </li> <li> <p>On <abbr title="GNU Compiler Collection">GCC</abbr>, 300+ warnings are enabled with 8 exceptions.</p> <details class=abstract> <summary><abbr title="GNU Compiler Collection">GCC</abbr> warnings</summary> <div class=highlight><pre><span></span><code><span class=c># Warning flags determined for GCC 15.1.0 with https://github.com/nlohmann/gcc_flags:</span>
|
||||
</code></pre></div> </details> </li> <li> <p>On <abbr title="GNU Compiler Collection">GCC</abbr>, 300+ warnings are enabled with 8 exceptions.</p> <details class=abstract> <summary><abbr title="GNU Compiler Collection">GCC</abbr> warnings</summary> <div class=highlight><pre><span></span><code><span class=c># Warning flags determined for GCC 16.2.0 with https://github.com/nlohmann/gcc_flags:</span>
|
||||
<span class=c># Ignored GCC warnings:</span>
|
||||
<span class=c># -Wno-abi-tag We do not care about ABI tags.</span>
|
||||
<span class=c># -Wno-aggregate-return The library uses aggregate returns.</span>
|
||||
@@ -44,6 +42,8 @@
|
||||
<span class=w> </span><span class=s>--extra-warnings</span>
|
||||
<span class=w> </span><span class=s>-W</span>
|
||||
<span class=w> </span><span class=s>-WNSObject-attribute</span>
|
||||
<span class=w> </span><span class=s>-Wabbreviated-auto-in-template-arg</span>
|
||||
<span class=w> </span><span class=s>-Wabi</span>
|
||||
<span class=w> </span><span class=s>-Wno-abi-tag</span>
|
||||
<span class=w> </span><span class=s>-Waddress</span>
|
||||
<span class=w> </span><span class=s>-Waddress-of-packed-member</span>
|
||||
@@ -92,6 +92,7 @@
|
||||
<span class=w> </span><span class=s>-Wanalyzer-tainted-divisor</span>
|
||||
<span class=w> </span><span class=s>-Wanalyzer-tainted-offset</span>
|
||||
<span class=w> </span><span class=s>-Wanalyzer-tainted-size</span>
|
||||
<span class=w> </span><span class=s>-Wanalyzer-throw-of-unexpected-type</span>
|
||||
<span class=w> </span><span class=s>-Wanalyzer-too-complex</span>
|
||||
<span class=w> </span><span class=s>-Wanalyzer-undefined-behavior-ptrdiff</span>
|
||||
<span class=w> </span><span class=s>-Wanalyzer-undefined-behavior-strtok</span>
|
||||
@@ -108,10 +109,13 @@
|
||||
<span class=w> </span><span class=s>-Warith-conversion</span>
|
||||
<span class=w> </span><span class=s>-Warray-bounds=2</span>
|
||||
<span class=w> </span><span class=s>-Warray-compare</span>
|
||||
<span class=w> </span><span class=s>-Warray-parameter</span>
|
||||
<span class=w> </span><span class=s>-Warray-parameter=2</span>
|
||||
<span class=w> </span><span class=s>-Wattribute-alias=2</span>
|
||||
<span class=w> </span><span class=s>-Wattribute-warning</span>
|
||||
<span class=w> </span><span class=s>-Wattributes</span>
|
||||
<span class=w> </span><span class=s>-Wauto-profile</span>
|
||||
<span class=w> </span><span class=s>-Wbidi-chars=any</span>
|
||||
<span class=w> </span><span class=s>-Wbool-compare</span>
|
||||
<span class=w> </span><span class=s>-Wbool-operation</span>
|
||||
<span class=w> </span><span class=s>-Wbuiltin-declaration-mismatch</span>
|
||||
@@ -127,6 +131,7 @@
|
||||
<span class=w> </span><span class=s>-Wc++20-compat</span>
|
||||
<span class=w> </span><span class=s>-Wc++20-extensions</span>
|
||||
<span class=w> </span><span class=s>-Wc++23-extensions</span>
|
||||
<span class=w> </span><span class=s>-Wc++26-compat</span>
|
||||
<span class=w> </span><span class=s>-Wc++26-extensions</span>
|
||||
<span class=w> </span><span class=s>-Wc++2a-compat</span>
|
||||
<span class=w> </span><span class=s>-Wcalloc-transposed-args</span>
|
||||
@@ -170,6 +175,7 @@
|
||||
<span class=w> </span><span class=s>-Wdeprecated-enum-enum-conversion</span>
|
||||
<span class=w> </span><span class=s>-Wdeprecated-enum-float-conversion</span>
|
||||
<span class=w> </span><span class=s>-Wdeprecated-literal-operator</span>
|
||||
<span class=w> </span><span class=s>-Wdeprecated-openmp</span>
|
||||
<span class=w> </span><span class=s>-Wdeprecated-variadic-comma-omission</span>
|
||||
<span class=w> </span><span class=s>-Wdisabled-optimization</span>
|
||||
<span class=w> </span><span class=s>-Wdiv-by-zero</span>
|
||||
@@ -184,21 +190,17 @@
|
||||
<span class=w> </span><span class=s>-Wenum-conversion</span>
|
||||
<span class=w> </span><span class=s>-Wexceptions</span>
|
||||
<span class=w> </span><span class=s>-Wexpansion-to-defined</span>
|
||||
<span class=w> </span><span class=s>-Wexpose-global-module-tu-local</span>
|
||||
<span class=w> </span><span class=s>-Wexternal-tu-local</span>
|
||||
<span class=w> </span><span class=s>-Wextra</span>
|
||||
<span class=w> </span><span class=s>-Wextra-semi</span>
|
||||
<span class=w> </span><span class=s>-Wflex-array-member-not-at-end</span>
|
||||
<span class=w> </span><span class=s>-Wfloat-conversion</span>
|
||||
<span class=w> </span><span class=s>-Wfloat-equal</span>
|
||||
<span class=w> </span><span class=s>-Wformat</span><span class=w> </span><span class=s>-Wformat-contains-nul</span>
|
||||
<span class=w> </span><span class=s>-Wformat</span><span class=w> </span><span class=s>-Wformat-diag</span>
|
||||
<span class=w> </span><span class=s>-Wformat</span><span class=w> </span><span class=s>-Wformat-extra-args</span>
|
||||
<span class=w> </span><span class=s>-Wformat</span><span class=w> </span><span class=s>-Wformat-nonliteral</span>
|
||||
<span class=w> </span><span class=s>-Wformat</span><span class=w> </span><span class=s>-Wformat-overflow=2</span>
|
||||
<span class=w> </span><span class=s>-Wformat</span><span class=w> </span><span class=s>-Wformat-security</span>
|
||||
<span class=w> </span><span class=s>-Wformat</span><span class=w> </span><span class=s>-Wformat-signedness</span>
|
||||
<span class=w> </span><span class=s>-Wformat</span><span class=w> </span><span class=s>-Wformat-truncation=2</span>
|
||||
<span class=w> </span><span class=s>-Wformat</span><span class=w> </span><span class=s>-Wformat-y2k</span>
|
||||
<span class=w> </span><span class=s>-Wformat</span><span class=w> </span><span class=s>-Wformat-zero-length</span>
|
||||
<span class=w> </span><span class=s>-Wformat-diag</span>
|
||||
<span class=w> </span><span class=s>-Wformat-overflow=2</span>
|
||||
<span class=w> </span><span class=s>-Wformat-signedness</span>
|
||||
<span class=w> </span><span class=s>-Wformat-truncation=2</span>
|
||||
<span class=w> </span><span class=s>-Wformat=2</span>
|
||||
<span class=w> </span><span class=s>-Wframe-address</span>
|
||||
<span class=w> </span><span class=s>-Wfree-nonheap-object</span>
|
||||
@@ -225,6 +227,8 @@
|
||||
<span class=w> </span><span class=s>-Winvalid-offsetof</span>
|
||||
<span class=w> </span><span class=s>-Winvalid-pch</span>
|
||||
<span class=w> </span><span class=s>-Winvalid-utf8</span>
|
||||
<span class=w> </span><span class=s>-Wkeyword-macro</span>
|
||||
<span class=w> </span><span class=s>-Wleading-whitespace=spaces</span>
|
||||
<span class=w> </span><span class=s>-Wliteral-suffix</span>
|
||||
<span class=w> </span><span class=s>-Wlogical-not-parentheses</span>
|
||||
<span class=w> </span><span class=s>-Wlogical-op</span>
|
||||
@@ -255,6 +259,7 @@
|
||||
<span class=w> </span><span class=s>-Wnarrowing</span>
|
||||
<span class=w> </span><span class=s>-Wnoexcept</span>
|
||||
<span class=w> </span><span class=s>-Wnoexcept-type</span>
|
||||
<span class=w> </span><span class=s>-Wnon-c-typedef-for-linkage</span>
|
||||
<span class=w> </span><span class=s>-Wnon-template-friend</span>
|
||||
<span class=w> </span><span class=s>-Wnon-virtual-dtor</span>
|
||||
<span class=w> </span><span class=s>-Wnonnull</span>
|
||||
@@ -297,6 +302,8 @@
|
||||
<span class=w> </span><span class=s>-Wscalar-storage-order</span>
|
||||
<span class=w> </span><span class=s>-Wself-move</span>
|
||||
<span class=w> </span><span class=s>-Wsequence-point</span>
|
||||
<span class=w> </span><span class=s>-Wsfinae-incomplete</span>
|
||||
<span class=w> </span><span class=s>-Wsfinae-incomplete=2</span>
|
||||
<span class=w> </span><span class=s>-Wshadow=compatible-local</span>
|
||||
<span class=w> </span><span class=s>-Wshadow=global</span>
|
||||
<span class=w> </span><span class=s>-Wshadow=local</span>
|
||||
@@ -317,6 +324,7 @@
|
||||
<span class=w> </span><span class=s>-Wstrict-aliasing=3</span>
|
||||
<span class=w> </span><span class=s>-Wstrict-null-sentinel</span>
|
||||
<span class=w> </span><span class=s>-Wstrict-overflow</span>
|
||||
<span class=w> </span><span class=s>-Wstrict-overflow=5</span>
|
||||
<span class=w> </span><span class=s>-Wstring-compare</span>
|
||||
<span class=w> </span><span class=s>-Wstringop-overflow</span>
|
||||
<span class=w> </span><span class=s>-Wstringop-overflow=4</span>
|
||||
@@ -361,8 +369,8 @@
|
||||
<span class=w> </span><span class=s>-Wunreachable-code</span>
|
||||
<span class=w> </span><span class=s>-Wunsafe-loop-optimizations</span>
|
||||
<span class=w> </span><span class=s>-Wunused</span>
|
||||
<span class=w> </span><span class=s>-Wunused-but-set-parameter</span>
|
||||
<span class=w> </span><span class=s>-Wunused-but-set-variable</span>
|
||||
<span class=w> </span><span class=s>-Wunused-but-set-parameter=3</span>
|
||||
<span class=w> </span><span class=s>-Wunused-but-set-variable=3</span>
|
||||
<span class=w> </span><span class=s>-Wunused-const-variable=2</span>
|
||||
<span class=w> </span><span class=s>-Wunused-function</span>
|
||||
<span class=w> </span><span class=s>-Wunused-label</span>
|
||||
@@ -389,12 +397,18 @@
|
||||
<span class=w> </span><span class=s>-Wzero-as-null-pointer-constant</span>
|
||||
<span class=w> </span><span class=s>-Wzero-length-bounds</span>
|
||||
<span class=p>)</span>
|
||||
</code></pre></div> </details> </li> </ul> <h2 id=c-standard-library-compliance>C++ standard library compliance<a class=headerlink href=#c-standard-library-compliance title="Permanent link">¶</a></h2> <div class="admonition success"> <p class=admonition-title>Requirement: No prerequisites</p> <p>The library has no prerequisites other than the Standard Template Library (<abbr title="Standard Template Library">STL</abbr>).</p> </div> <ul class=task-list> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The library is compiled and tested with both <a href="https://libcxx.llvm.org">libc++</a> and <a href="https://gcc.gnu.org/onlinedocs/libstdc++/">libstdc++</a> to detect subtle differences or incompatibilities.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The code checked with <a href="https://include-what-you-use.org">Include What You Use (IWYU)</a> that all required standard headers are included.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> On Windows, the library is compiled with <code><Windows.h></code> being included to detect and avoid common bugs.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The library is compiled with exceptions disabled to support alternative means of error handling.</li> </ul> <h2 id=stable-public-api>Stable public <abbr title="Application Programming Interfaces">API</abbr><a class=headerlink href=#stable-public-api title="Permanent link">¶</a></h2> <div class="admonition success"> <p class=admonition-title>Requirement: Stable public <abbr title="Application Programming Interfaces">API</abbr></p> <p>Any change to the library does not break the public <abbr title="Application Programming Interfaces">API</abbr>.</p> </div> <ul class=task-list> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> All public <abbr title="Application Programming Interfaces">API</abbr> functions are tested with a variety of arguments.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The library is compiled and tested with different template arguments for number, string, array, and object types.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> Unit tests cover all lines of the code base.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> Every exception of the library is thrown in the test suite, and the error messages and exception ids are checked.</li> </ul> <div class="admonition success"> <p class=admonition-title>Requirement: Complete documentation</p> <p>The public <abbr title="Application Programming Interfaces">API</abbr> is extensively documented.</p> </div> <ul class=task-list> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> Every public <abbr title="Application Programming Interfaces">API</abbr> function has a dedicated page in the <a href="https://json.nlohmann.me/api/basic_json/"><abbr title="Application Programming Interfaces">API</abbr> reference documentation</a> with a self-contained code example.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> All examples in the documentation are tested, and changes in their output are treated as an error.</li> </ul> <h2 id=robust-input-processing>Robust input processing<a class=headerlink href=#robust-input-processing title="Permanent link">¶</a></h2> <div class="admonition success"> <p class=admonition-title>Requirement: Standards compliance</p> <p>The library is compliant to <abbr title="JavaScript Object Notation">JSON</abbr> as defined in <a href="https://datatracker.ietf.org/doc/html/rfc8259"><abbr title="Request for Comments">RFC</abbr> 8259</a>.</p> </div> <ul class=task-list> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The lexer is tested with all valid Unicode code points and all prefixes of all invalid Unicode code points.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The parser is tested against extensive correctness suites for <abbr title="JavaScript Object Notation">JSONLine truncated
|
||||
<span class=c1># TODO: portability-avoid-pragma-once: should be fixed eventually</span>
|
||||
</code></pre></div> </details> </li> </ul> <h2 id=c-standard-library-compliance>C++ standard library compliance<a class=headerlink href=#c-standard-library-compliance title="Permanent link">¶</a></h2> <div class="admonition success"> <p class=admonition-title>Requirement: No prerequisites</p> <p>The library has no prerequisites other than the Standard Template Library (<abbr title="Standard Template Library">STL</abbr>).</p> </div> <ul class=task-list> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The library is compiled and tested with both <a href="https://libcxx.llvm.org">libc++</a> and <a href="https://gcc.gnu.org/onlinedocs/libstdc++/">libstdc++</a> to detect subtle differences or incompatibilities.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The code checked with <a href="https://include-what-you-use.org">Include What You Use (IWYU)</a> that all required standard headers are included.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> On Windows, the library is compiled with <code><Windows.h></code> being included to detect and avoid common bugs (see <a href="https://github.com/nlohmann/json/blob/develop/tests/src/unit-windows_h.cpp"><code>unit-windows_h.cpp</code></a>).</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The library is compiled with exceptions disabled to support alternative means of error handling.</li> </ul> <h2 id=stable-public-api>Stable public <abbr title="Application Programming Interfaces">API</abbr><a class=headerlink href=#stable-public-api title="Permanent link">¶</a></h2> <div class="admonition success"> <p class=admonition-title>Requirement: Stable public <abbr title="Application Programming Interfaces">API</abbr></p> <p>Any change to the library does not break the public <abbr title="Application Programming Interfaces">API</abbr>.</p> </div> <ul class=task-list> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> All public <abbr title="Application Programming Interfaces">API</abbr> functions are tested with a variety of arguments.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The library is compiled and tested with different template arguments for number, string, array, and object types.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> Unit tests cover all lines of the code base.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> Every exception of the library is thrown in the test suite, and the error messages and exception ids are checked.</li> </ul> <div class="admonition success"> <p class=admonition-title>Requirement: Complete documentation</p> <p>The public <abbr title="Application Programming Interfaces">API</abbr> is extensively documented.</p> </div> <ul class=task-list> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> Every public <abbr title="Application Programming Interfaces">API</abbr> function has a dedicated page in the <a href="https://json.nlohmann.me/api/basic_json/"><abbr title="Application Programming Interfaces">API</abbr> reference documentation</a> with a self-contained code example.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> All examples in the documentation are tested, and changes in their output are treated as an error.</li> </ul> <h2 id=robust-input-processing>Robust input processing<a class=headerlink href=#robust-input-processing title="Permanent link">¶</a></h2> <div class="admonition success"> <p class=admonition-title>Requirement: Standards compliance</p> <p>The library is compliant to <abbr title="JavaScript Object Notation">JSON</abbr> as defined in <a href="https://datatracker.ietf.org/doc/html/rfc8259"><abbr title="Request for Comments">RFC</abbr> 8259</a>.</p> </div> <ul class=task-list> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The lexer is tested with all valid Unicode code points and all prefixes of all invalid Unicode code points.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicaLine truncated
|
||||
<span class=c1># the basic_json move constructor, which forwards the whole object to its base</span>
|
||||
<span class=c1># class (#5724), and two forwards in the error-message construction of</span>
|
||||
<span class=c1># at(KeyType&&) (json.hpp, both overloads: find(std::forward<KeyType>(key))</span>
|
||||
<span class=c1># followed by string_t(std::forward<KeyType>(key)) in the throw), which #5689</span>
|
||||
<span class=c1># rewrites. Re-enable both checks once those changes have landed.</span>
|
||||
<span class=c1># portability-avoid-pragma-once: kept disabled on purpose. #pragma once is accepted</span>
|
||||
<span class=c1># by every supported compiler, and tools/amalgamate/amalgamate.py strips it from</span>
|
||||
<span class=c1># single_include, so there is nothing left to fix here.</span>
|
||||
|
||||
<span class=na>Checks</span><span class=o>:</span><span class=w> </span><span class=s>'</span><span class=err>*,</span>
|
||||
|
||||
<span class=w> </span><span class=na>-portability-template-virtual-member-function,</span>
|
||||
<span class=w> </span><span class=na>-bugprone-use-after-move,</span>
|
||||
<span class=w> </span><span class=na>-hicpp-invalid-access-moved,</span>
|
||||
|
||||
@@ -428,7 +442,6 @@
|
||||
<span class=w> </span><span class=na>-google-readability-function-size,</span>
|
||||
<span class=w> </span><span class=na>-google-runtime-float,</span>
|
||||
<span class=w> </span><span class=na>-google-runtime-int,</span>
|
||||
<span class=w> </span><span class=na>-google-runtime-references,</span>
|
||||
<span class=w> </span><span class=na>-hicpp-avoid-goto,</span>
|
||||
<span class=w> </span><span class=na>-hicpp-explicit-conversions,</span>
|
||||
<span class=w> </span><span class=na>-hicpp-function-size,</span>
|
||||
@@ -462,6 +475,7 @@
|
||||
<span class=w> </span><span class=na>-readability-magic-numbers,</span>
|
||||
<span class=w> </span><span class=na>-readability-redundant-access-specifiers,</span>
|
||||
<span class=w> </span><span class=na>-readability-redundant-parentheses,</span>
|
||||
<span class=w> </span><span class=na>-readability-redundant-typename,</span>
|
||||
<span class=w> </span><span class=na>-readability-simplify-boolean-expr,</span>
|
||||
<span class=w> </span><span class=na>-readability-uppercase-literal-suffix,</span>
|
||||
<span class=w> </span><span class=na>-readability-use-concise-preprocessor-directives'</span>
|
||||
@@ -469,10 +483,13 @@
|
||||
<span class=na>CheckOptions</span><span class=o>:</span>
|
||||
<span class=w> </span><span class=na>- key</span><span class=o>:</span><span class=w> </span><span class=s>hicpp-special-member-functions.AllowSoleDefaultDtor</span>
|
||||
<span class=w> </span><span class=na>value</span><span class=o>:</span><span class=w> </span><span class=s>1</span>
|
||||
<span class=w> </span><span class=c1># clang-tidy 22.1 extended this check to classes and enums; the test files</span>
|
||||
<span class=w> </span><span class=c1># define many such helper types at namespace scope, which is harmless</span>
|
||||
<span class=w> </span><span class=na>- key</span><span class=o>:</span><span class=w> </span><span class=s>misc-use-internal-linkage.AnalyzeTypes</span>
|
||||
<span class=w> </span><span class=na>value</span><span class=o>:</span><span class=w> </span><span class=s>false</span>
|
||||
|
||||
<span class=na>WarningsAsErrors</span><span class=o>:</span><span class=w> </span><span class=s>'*'</span>
|
||||
|
||||
<span class=c1>#HeaderFilterRegex: '.*nlohmann.*'</span>
|
||||
<span class=na>HeaderFilterRegex</span><span class=o>:</span><span class=w> </span><span class=s>'.*hpp$'</span>
|
||||
</code></pre></div> </details> </li> <li class=task-list-item> <p><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The code is checked with the latest <a href="https://cppcheck.sourceforge.io">Cppcheck</a> with all warnings enabled.</p> </li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The code is checked with the latest <a href="https://clang-analyzer.llvm.org">Clang Static Analyzer</a> with 89 enabled rules.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The code is checked with <a href="https://fbinfer.com">Infer</a>.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The code is checked with <a href="https://app.codacy.com/gh/nlohmann/json/dashboard">Codacy</a>.</li> </ul> <h2 id=dynamic-analysis>Dynamic analysis<a class=headerlink href=#dynamic-analysis title="Permanent link">¶</a></h2> <div class="admonition success"> <p class=admonition-title>Requirement: Correctness</p> <p>The library is checked for memory correctness and absence of undefined behavior.</p> </div> <ul class=task-list> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The test suite is executed with enabled <a href="https://json.nlohmann.me/features/assertions/">runtime assertions</a> to check invariants and preconditions of functions to detect undefined behavior.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The test suite is executed with <a href="https://valgrind.org">Valgrind</a> (Memcheck) to detect memory leaks.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The test suite is executed with <a href="https://github.com/google/sanitizers">Sanitizers</a> (address sanitizer, undefined behavior sanitizer, integer overflow detection, nullability violations).</li> </ul> <h2 id=dependencies>Dependencies<a class=headerlink href=#dependencies title="Permanent link">¶</a></h2> <div class="admonition success"> <p class=admonition-title>Requirement: No vulnerable dependencies</p> <p>The library has no dependencies besides the C++ standard library. The tools used to build, test, and document it are kept free of known vulnerabilities.</p> </div> <ul class=task-list> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> GitHub Actions are pinned to a commit hash, and the Python packages used by the documentation and the tools are pinned to exact versions.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> <a href="https://docs.github.com/en/code-security/dependabot">Dependabot</a> checks these dependencies daily and proposes updates as pull requests.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> Every pull request is checked with the <a href="https://github.com/actions/dependency-review-action">dependency review action</a>. A pull request that adds a dependency with a known vulnerability of any severity fails this check and is not merged.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> Vulnerability alerts for dependencies are fixed or dismissed with a documented reason before the next release. No release is made while such an alert is open.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> Third-party code included in the repository for testing, such as <a href="https://github.com/doctest/doctest">doctest</a>, is updated manually.</li> </ul> <h2 id=style-check>Style check<a class=headerlink href=#style-check title="Permanent link">¶</a></h2> <div class="admonition success"> <p class=admonition-title>Requirement: Common code style</p> <p>A common code style is used throughout all code files of the library.</p> </div> <ul class=task-list> <li class=task-list-item> <p><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The code is formatted with <a href="https://astyle.sourceforge.net">Artistic Style</a> (astyle) against a style configuration that is also enforced in the <abbr title="Continuous Integration">CI</abbr>.</p> <details class=abstract> <summarLine truncated
|
||||
<span class=c1># see https://astyle.sourceforge.net/astyle.html</span>
|
||||
@@ -554,4 +571,4 @@
|
||||
|
||||
<span class=c1># for the linux (LF) line end style</span>
|
||||
<span class=na>--lineend</span><span class=o>=</span><span class=s>linux</span>
|
||||
</code></pre></div> </details> </li> <li class=task-list-item> <p><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The code style is checked with <a href="https://github.com/cpplint/cpplint">cpplint</a> with 61 enabled rules.</p> </li> </ul> <h2 id=simple-integration>Simple integration<a class=headerlink href=#simple-integration title="Permanent link">¶</a></h2> <div class="admonition success"> <p class=admonition-title>Requirement: Single header</p> <p>The library can be used by adding a single header to a C++ project.</p> </div> <ul class=task-list> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> An amalgamation script is used to check if the source code is exposed as a self-contained single-header file.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The test suite is checked against the amalgamated source file as well as the individual source file.</li> </ul> <div class="admonition success"> <p class=admonition-title>Requirement: CMake as primary development tool</p> <p>All library functions are exposed and usable by CMake.</p> </div> <ul class=task-list> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> All library options are exposed as <a href="https://json.nlohmann.me/integration/cmake/">CMake options</a> and tested.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The library is tested against relevant CMake versions:</li> <li>CMake 3.5 (the earliest supported)</li> <li>CMake 3.31.6 (the latest 3.x release)</li> <li>CMake 4.0.0 (a very recent release)</li> </ul> <!-- https://squidfunk.github.io/mkdocs-material/reference/tooltips/#adding-a-glossary --> <aside class=md-source-file> <span class=md-source-file__fact> <span class=md-icon title="Last update"> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M21 13.1c-.1 0-.3.1-.4.2l-1 1 2.1 2.1 1-1c.2-.2.2-.6 0-.8l-1.3-1.3c-.1-.1-.2-.2-.4-.2m-1.9 1.8-6.1 6V23h2.1l6.1-6.1zM12.5 7v5.2l4 2.4-1 1L11 13V7zM11 21.9c-5.1-.5-9-4.8-9-9.9C2 6.5 6.5 2 12 2c5.3 0 9.6 4.1 10 9.3-.3-.1-.6-.2-1-.2s-.7.1-1 .2C19.6 7.2 16.2 4 12 4c-4.4 0-8 3.6-8 8 0 4.1 3.1 7.5 7.1 7.9l-.1.2z"/></svg> </span> <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date" title="September 30, 2026 18:06:26 UTC">September 30, 2026</span> </span> </aside> </article> </div> <script>var tabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(var set of document.querySelectorAll(".tabbed-set")){var labels=set.querySelector(".tabbed-labels");for(var tab of tabs)for(var label of labels.getElementsByTagName("label"))if(label.innerText.trim()===tab){var input=document.getElementById(label.htmlFor);input.checked=!0;continue e}}</script> <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script> </div> <button type=button class="md-top md-icon" data-md-component=top hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg> Back to top </button> </main> <footer class=md-footer> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class=md-copyright> <div class=md-copyright__highlight> Copyright © 2013-2026 Niels Lohmann </div> </div> <div class=md-social> <a href="https://github.com/nlohmann" target="_blank" rel="noopener" title="github.com" class="md-social__link"> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 512 512"><!-- Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M173.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6m-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3m44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9M252.8 8C114.1 8 8 113.3 8 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C436.2 457.Line truncated
|
||||
</code></pre></div> </details> </li> <li class=task-list-item> <p><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The code style is checked with <a href="https://github.com/cpplint/cpplint">cpplint</a> with 61 enabled rules.</p> </li> </ul> <h2 id=simple-integration>Simple integration<a class=headerlink href=#simple-integration title="Permanent link">¶</a></h2> <div class="admonition success"> <p class=admonition-title>Requirement: Single header</p> <p>The library can be used by adding a single header to a C++ project.</p> </div> <ul class=task-list> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> An amalgamation script is used to check if the source code is exposed as a self-contained single-header file.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The test suite is checked against the amalgamated source file as well as the individual source file.</li> </ul> <div class="admonition success"> <p class=admonition-title>Requirement: CMake as primary development tool</p> <p>All library functions are exposed and usable by CMake.</p> </div> <ul class=task-list> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> All library options are exposed as <a href="https://json.nlohmann.me/integration/cmake/">CMake options</a> and tested.</li> <li class=task-list-item><label class=task-list-control><input type=checkbox disabled checked><span class=task-list-indicator></span></label> The library is tested against relevant CMake versions:</li> <li>CMake 3.5 (the earliest supported)</li> <li>CMake 3.31.6 (the latest 3.x release)</li> <li>CMake 4.0.0 (a very recent release)</li> </ul> <!-- https://squidfunk.github.io/mkdocs-material/reference/tooltips/#adding-a-glossary --> <aside class=md-source-file> <span class=md-source-file__fact> <span class=md-icon title="Last update"> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M21 13.1c-.1 0-.3.1-.4.2l-1 1 2.1 2.1 1-1c.2-.2.2-.6 0-.8l-1.3-1.3c-.1-.1-.2-.2-.4-.2m-1.9 1.8-6.1 6V23h2.1l6.1-6.1zM12.5 7v5.2l4 2.4-1 1L11 13V7zM11 21.9c-5.1-.5-9-4.8-9-9.9C2 6.5 6.5 2 12 2c5.3 0 9.6 4.1 10 9.3-.3-.1-.6-.2-1-.2s-.7.1-1 .2C19.6 7.2 16.2 4 12 4c-4.4 0-8 3.6-8 8 0 4.1 3.1 7.5 7.1 7.9l-.1.2z"/></svg> </span> <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date" title="October 2, 2026 09:23:55 UTC">October 2, 2026</span> </span> </aside> </article> </div> <script>var tabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(var set of document.querySelectorAll(".tabbed-set")){var labels=set.querySelector(".tabbed-labels");for(var tab of tabs)for(var label of labels.getElementsByTagName("label"))if(label.innerText.trim()===tab){var input=document.getElementById(label.htmlFor);input.checked=!0;continue e}}</script> <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script> </div> <button type=button class="md-top md-icon" data-md-component=top hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg> Back to top </button> </main> <footer class=md-footer> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class=md-copyright> <div class=md-copyright__highlight> Copyright © 2013-2026 Niels Lohmann </div> </div> <div class=md-social> <a href="https://github.com/nlohmann" target="_blank" rel="noopener" title="github.com" class="md-social__link"> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 512 512"><!-- Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M173.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6m-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3m44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9M252.8 8C114.1 8 8 113.3 8 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C436.2 457.8 504 Line truncated
|
||||
@@ -16,89 +16,89 @@ Note: Some modern features (like C++20 ranges or filesystem support) may be disa
|
||||
|
||||
Compilers used in continuous integration
|
||||
|
||||
| Compiler | Architecture | Operating System | CI |
|
||||
| -------------------------------------------- | ------------ | --------------------------------- | --------- |
|
||||
| AppleClang 15.0.0.15000040; Xcode 15.0.1 | arm64 | macOS 14.7.2 (Sonoma) | GitHub |
|
||||
| AppleClang 15.0.0.15000100; Xcode 15.1 | arm64 | macOS 14.7.2 (Sonoma) | GitHub |
|
||||
| AppleClang 15.0.0.15000100; Xcode 15.2 | arm64 | macOS 14.7.2 (Sonoma) | GitHub |
|
||||
| AppleClang 15.0.0.15000309; Xcode 15.3 | arm64 | macOS 14.7.2 (Sonoma) | GitHub |
|
||||
| AppleClang 15.0.0.15000309; Xcode 15.4 | arm64 | macOS 14.7.2 (Sonoma) | GitHub |
|
||||
| AppleClang 16.0.0.16000026; Xcode 16 | arm64 | macOS 15.2 (Sequoia) | GitHub |
|
||||
| AppleClang 16.0.0.16000026; Xcode 16.1 | arm64 | macOS 15.2 (Sequoia) | GitHub |
|
||||
| AppleClang 16.0.0.16000026; Xcode 16.2 | arm64 | macOS 15.2 (Sequoia) | GitHub |
|
||||
| AppleClang 17.0.0.17000013; Xcode 16.3 | arm64 | macOS 15.5 (Sequoia) | GitHub |
|
||||
| AppleClang 17.0.0.17000013; Xcode 16.4 | arm64 | macOS 15.5 (Sequoia) | GitHub |
|
||||
| AppleClang 17.0.0.17000319; Xcode 26.0.1 | arm64 | macOS 15.5 (Sequoia) | GitHub |
|
||||
| Clang 3.4.2 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 3.5.2 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 3.6.2 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 3.7.1 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 3.8.1 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 3.9.1 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 4.0.1 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 5.0.2 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 6.0.1 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 7.1.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 8.0.1 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 9.0.1 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 10.0.1 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 11.0.1 with GNU-like command-line | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| Clang 11.1.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 12.0.1 with GNU-like command-line | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| Clang 12.0.1 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 13.0.1 with GNU-like command-line | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| Clang 13.0.1 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 14.0.6 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 14.0.6 with GNU-like command-line | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| Clang 15.0.7 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 15.0.7 with GNU-like command-line | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| Clang 16.0.6 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 16.0.6 with GNU-like command-line | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| Clang 17.0.6 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 18.1.8 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 18.1.8 with GNU-like command-line | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| Clang 19.1.5 with MSVC-like command-line | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| Clang 19.1.7 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 19.1.7 with GNU-like command-line | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| Clang 20.1.1 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 20.1.8 with GNU-like command-line | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| Clang 21.1.8 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 22.1.8 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| CUDA 11.8.0 (nvcc) | x86_64 | Ubuntu 22.04 LTS | GitHub |
|
||||
| CUDA 12.1.1 (nvcc) | x86_64 | Ubuntu 22.04 LTS | GitHub |
|
||||
| CUDA 12.6.3 (nvcc) | x86_64 | Ubuntu 22.04 LTS | GitHub |
|
||||
| Emscripten 4.0.6 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 4.8.5 | x86_64 | Ubuntu 20.04 LTS | GitHub |
|
||||
| GNU 4.9.3 | x86_64 | Ubuntu 20.04 LTS | GitHub |
|
||||
| GNU 5.5.0 | x86_64 | Ubuntu 20.04 LTS | GitHub |
|
||||
| GNU 6.4.0 | x86_64 | Ubuntu 20.04 LTS | GitHub |
|
||||
| GNU 7.5.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 8.5.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 9.3.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 9.4.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 9.5.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 10.5.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 11.4.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 11.5.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 12.2.0 (MinGW-W64 i686-ucrt-posix-dwarf) | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| GNU 12.2.0 (MinGW-W64 x86_64-ucrt-posix-seh) | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| GNU 12.4.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 13.3.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 14.2.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 15.1.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 16.1.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 16.1.0 | arm64 | Linux 6.1.100 | Cirrus CI |
|
||||
| icpc (ICC) 2021.10.0 20230609 | x86_64 | Ubuntu 22.04 LTS | GitHub |
|
||||
| icpx (Intel oneAPI DPC++/C++) 2025.3.2 | x86_64 | Ubuntu 24.04 LTS | GitHub |
|
||||
| nvc++ (NVIDIA HPC SDK) 25.5-0 | x86_64 | Ubuntu 22.04 LTS | GitHub |
|
||||
| MSVC 19.0.24241.7 | x86 | Windows 8.1 | AppVeyor |
|
||||
| MSVC 19.16.27035.0 | x86 | Windows-10 (Build 14393) | AppVeyor |
|
||||
| MSVC 19.29.30157.0 | x86 | Windows-10 (Build 17763) | AppVeyor |
|
||||
| MSVC 19.44.35207.0 | arm64 | Windows 11 (Build 26200) | GitHub |
|
||||
| MSVC 19.44.35214.0 | x86 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| MSVC 19.44.35214.0 | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| MSVC 19.51.36231.0 | x86 | Windows Server 2025 (Build 26100) | GitHub |
|
||||
| MSVC 19.51.36231.0 | x86_64 | Windows Server 2025 (Build 26100) | GitHub |
|
||||
| Compiler | Architecture | Operating System | CI |
|
||||
| -------------------------------------------- | ------------ | --------------------------------- | -------- |
|
||||
| AppleClang 15.0.0.15000040; Xcode 15.0.1 | arm64 | macOS 14.7.2 (Sonoma) | GitHub |
|
||||
| AppleClang 15.0.0.15000100; Xcode 15.1 | arm64 | macOS 14.7.2 (Sonoma) | GitHub |
|
||||
| AppleClang 15.0.0.15000100; Xcode 15.2 | arm64 | macOS 14.7.2 (Sonoma) | GitHub |
|
||||
| AppleClang 15.0.0.15000309; Xcode 15.3 | arm64 | macOS 14.7.2 (Sonoma) | GitHub |
|
||||
| AppleClang 15.0.0.15000309; Xcode 15.4 | arm64 | macOS 14.7.2 (Sonoma) | GitHub |
|
||||
| AppleClang 16.0.0.16000026; Xcode 16 | arm64 | macOS 15.2 (Sequoia) | GitHub |
|
||||
| AppleClang 16.0.0.16000026; Xcode 16.1 | arm64 | macOS 15.2 (Sequoia) | GitHub |
|
||||
| AppleClang 16.0.0.16000026; Xcode 16.2 | arm64 | macOS 15.2 (Sequoia) | GitHub |
|
||||
| AppleClang 17.0.0.17000013; Xcode 16.3 | arm64 | macOS 15.5 (Sequoia) | GitHub |
|
||||
| AppleClang 17.0.0.17000013; Xcode 16.4 | arm64 | macOS 15.5 (Sequoia) | GitHub |
|
||||
| AppleClang 17.0.0.17000319; Xcode 26.0.1 | arm64 | macOS 15.5 (Sequoia) | GitHub |
|
||||
| Clang 3.4.2 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 3.5.2 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 3.6.2 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 3.7.1 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 3.8.1 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 3.9.1 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 4.0.1 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 5.0.2 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 6.0.1 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 7.1.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 8.0.1 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 9.0.1 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 10.0.1 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 11.0.1 with GNU-like command-line | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| Clang 11.1.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 12.0.1 with GNU-like command-line | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| Clang 12.0.1 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 13.0.1 with GNU-like command-line | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| Clang 13.0.1 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 14.0.6 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 14.0.6 with GNU-like command-line | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| Clang 15.0.7 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 15.0.7 with GNU-like command-line | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| Clang 16.0.6 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 16.0.6 with GNU-like command-line | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| Clang 17.0.6 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 18.1.8 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 18.1.8 with GNU-like command-line | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| Clang 19.1.5 with MSVC-like command-line | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| Clang 19.1.7 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 19.1.7 with GNU-like command-line | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| Clang 20.1.1 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 20.1.8 with GNU-like command-line | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| Clang 21.1.8 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| Clang 22.1.8 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| CUDA 11.8.0 (nvcc) | x86_64 | Ubuntu 22.04 LTS | GitHub |
|
||||
| CUDA 12.1.1 (nvcc) | x86_64 | Ubuntu 22.04 LTS | GitHub |
|
||||
| CUDA 12.6.3 (nvcc) | x86_64 | Ubuntu 22.04 LTS | GitHub |
|
||||
| Emscripten 4.0.6 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 4.8.5 | x86_64 | Ubuntu 20.04 LTS | GitHub |
|
||||
| GNU 4.9.3 | x86_64 | Ubuntu 20.04 LTS | GitHub |
|
||||
| GNU 5.5.0 | x86_64 | Ubuntu 20.04 LTS | GitHub |
|
||||
| GNU 6.4.0 | x86_64 | Ubuntu 20.04 LTS | GitHub |
|
||||
| GNU 7.5.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 8.5.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 9.3.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 9.4.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 9.5.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 10.5.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 11.4.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 11.5.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 12.2.0 (MinGW-W64 i686-ucrt-posix-dwarf) | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| GNU 12.2.0 (MinGW-W64 x86_64-ucrt-posix-seh) | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| GNU 12.4.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 13.3.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 14.2.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 15.1.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 16.1.0 | x86_64 | Ubuntu 22.04.1 LTS | GitHub |
|
||||
| GNU 16.1.0 | arm64 | Ubuntu 24.04 | GitHub |
|
||||
| icpc (ICC) 2021.10.0 20230609 | x86_64 | Ubuntu 22.04 LTS | GitHub |
|
||||
| icpx (Intel oneAPI DPC++/C++) 2025.3.2 | x86_64 | Ubuntu 24.04 LTS | GitHub |
|
||||
| nvc++ (NVIDIA HPC SDK) 25.5-0 | x86_64 | Ubuntu 22.04 LTS | GitHub |
|
||||
| MSVC 19.0.24241.7 | x86 | Windows 8.1 | AppVeyor |
|
||||
| MSVC 19.16.27035.0 | x86 | Windows-10 (Build 14393) | AppVeyor |
|
||||
| MSVC 19.29.30157.0 | x86 | Windows-10 (Build 17763) | AppVeyor |
|
||||
| MSVC 19.44.35207.0 | arm64 | Windows 11 (Build 26200) | GitHub |
|
||||
| MSVC 19.44.35214.0 | x86 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| MSVC 19.44.35214.0 | x86_64 | Windows Server 2022 (Build 20348) | GitHub |
|
||||
| MSVC 19.51.36231.0 | x86 | Windows Server 2025 (Build 26100) | GitHub |
|
||||
| MSVC 19.51.36231.0 | x86_64 | Windows Server 2025 (Build 26100) | GitHub |
|
||||
|
||||
- The library is compiled with all C++ language revisions (C++11, C++14, C++17, C++20, C++23, and C++26) to detect and fix language deprecations early.
|
||||
|
||||
@@ -113,7 +113,6 @@ Note: Some modern features (like C++20 ranges or filesystem support) may be disa
|
||||
# -Wno-c++98-compat The library targets C++11.
|
||||
# -Wno-c++98-compat-pedantic The library targets C++11.
|
||||
# -Wno-deprecated-declarations The library contains annotations for deprecated functions.
|
||||
# -Wno-extra-semi-stmt The library uses assert which triggers this warning.
|
||||
# -Wno-padded We do not care about padding warnings.
|
||||
# -Wno-covered-switch-default All switches list all cases and a default case.
|
||||
# -Wno-c2y-extensions Clang 22.1 diagnoses __COUNTER__ as a C2y extension, also in
|
||||
@@ -131,7 +130,6 @@ Note: Some modern features (like C++20 ranges or filesystem support) may be disa
|
||||
-Wno-c++98-compat
|
||||
-Wno-c++98-compat-pedantic
|
||||
-Wno-deprecated-declarations
|
||||
-Wno-extra-semi-stmt
|
||||
-Wno-padded
|
||||
-Wno-covered-switch-default
|
||||
-Wno-c2y-extensions
|
||||
@@ -144,7 +142,7 @@ Note: Some modern features (like C++20 ranges or filesystem support) may be disa
|
||||
GCC warnings
|
||||
|
||||
```
|
||||
# Warning flags determined for GCC 15.1.0 with https://github.com/nlohmann/gcc_flags:
|
||||
# Warning flags determined for GCC 16.2.0 with https://github.com/nlohmann/gcc_flags:
|
||||
# Ignored GCC warnings:
|
||||
# -Wno-abi-tag We do not care about ABI tags.
|
||||
# -Wno-aggregate-return The library uses aggregate returns.
|
||||
@@ -162,6 +160,8 @@ Note: Some modern features (like C++20 ranges or filesystem support) may be disa
|
||||
--extra-warnings
|
||||
-W
|
||||
-WNSObject-attribute
|
||||
-Wabbreviated-auto-in-template-arg
|
||||
-Wabi
|
||||
-Wno-abi-tag
|
||||
-Waddress
|
||||
-Waddress-of-packed-member
|
||||
@@ -210,6 +210,7 @@ Note: Some modern features (like C++20 ranges or filesystem support) may be disa
|
||||
-Wanalyzer-tainted-divisor
|
||||
-Wanalyzer-tainted-offset
|
||||
-Wanalyzer-tainted-size
|
||||
-Wanalyzer-throw-of-unexpected-type
|
||||
-Wanalyzer-too-complex
|
||||
-Wanalyzer-undefined-behavior-ptrdiff
|
||||
-Wanalyzer-undefined-behavior-strtok
|
||||
@@ -226,10 +227,13 @@ Note: Some modern features (like C++20 ranges or filesystem support) may be disa
|
||||
-Warith-conversion
|
||||
-Warray-bounds=2
|
||||
-Warray-compare
|
||||
-Warray-parameter
|
||||
-Warray-parameter=2
|
||||
-Wattribute-alias=2
|
||||
-Wattribute-warning
|
||||
-Wattributes
|
||||
-Wauto-profile
|
||||
-Wbidi-chars=any
|
||||
-Wbool-compare
|
||||
-Wbool-operation
|
||||
-Wbuiltin-declaration-mismatch
|
||||
@@ -245,6 +249,7 @@ Note: Some modern features (like C++20 ranges or filesystem support) may be disa
|
||||
-Wc++20-compat
|
||||
-Wc++20-extensions
|
||||
-Wc++23-extensions
|
||||
-Wc++26-compat
|
||||
-Wc++26-extensions
|
||||
-Wc++2a-compat
|
||||
-Wcalloc-transposed-args
|
||||
@@ -288,6 +293,7 @@ Note: Some modern features (like C++20 ranges or filesystem support) may be disa
|
||||
-Wdeprecated-enum-enum-conversion
|
||||
-Wdeprecated-enum-float-conversion
|
||||
-Wdeprecated-literal-operator
|
||||
-Wdeprecated-openmp
|
||||
-Wdeprecated-variadic-comma-omission
|
||||
-Wdisabled-optimization
|
||||
-Wdiv-by-zero
|
||||
@@ -302,21 +308,17 @@ Note: Some modern features (like C++20 ranges or filesystem support) may be disa
|
||||
-Wenum-conversion
|
||||
-Wexceptions
|
||||
-Wexpansion-to-defined
|
||||
-Wexpose-global-module-tu-local
|
||||
-Wexternal-tu-local
|
||||
-Wextra
|
||||
-Wextra-semi
|
||||
-Wflex-array-member-not-at-end
|
||||
-Wfloat-conversion
|
||||
-Wfloat-equal
|
||||
-Wformat -Wformat-contains-nul
|
||||
-Wformat -Wformat-diag
|
||||
-Wformat -Wformat-extra-args
|
||||
-Wformat -Wformat-nonliteral
|
||||
-Wformat -Wformat-overflow=2
|
||||
-Wformat -Wformat-security
|
||||
-Wformat -Wformat-signedness
|
||||
-Wformat -Wformat-truncation=2
|
||||
-Wformat -Wformat-y2k
|
||||
-Wformat -Wformat-zero-length
|
||||
-Wformat-diag
|
||||
-Wformat-overflow=2
|
||||
-Wformat-signedness
|
||||
-Wformat-truncation=2
|
||||
-Wformat=2
|
||||
-Wframe-address
|
||||
-Wfree-nonheap-object
|
||||
@@ -343,6 +345,8 @@ Note: Some modern features (like C++20 ranges or filesystem support) may be disa
|
||||
-Winvalid-offsetof
|
||||
-Winvalid-pch
|
||||
-Winvalid-utf8
|
||||
-Wkeyword-macro
|
||||
-Wleading-whitespace=spaces
|
||||
-Wliteral-suffix
|
||||
-Wlogical-not-parentheses
|
||||
-Wlogical-op
|
||||
@@ -373,6 +377,7 @@ Note: Some modern features (like C++20 ranges or filesystem support) may be disa
|
||||
-Wnarrowing
|
||||
-Wnoexcept
|
||||
-Wnoexcept-type
|
||||
-Wnon-c-typedef-for-linkage
|
||||
-Wnon-template-friend
|
||||
-Wnon-virtual-dtor
|
||||
-Wnonnull
|
||||
@@ -415,6 +420,8 @@ Note: Some modern features (like C++20 ranges or filesystem support) may be disa
|
||||
-Wscalar-storage-order
|
||||
-Wself-move
|
||||
-Wsequence-point
|
||||
-Wsfinae-incomplete
|
||||
-Wsfinae-incomplete=2
|
||||
-Wshadow=compatible-local
|
||||
-Wshadow=global
|
||||
-Wshadow=local
|
||||
@@ -435,6 +442,7 @@ Note: Some modern features (like C++20 ranges or filesystem support) may be disa
|
||||
-Wstrict-aliasing=3
|
||||
-Wstrict-null-sentinel
|
||||
-Wstrict-overflow
|
||||
-Wstrict-overflow=5
|
||||
-Wstring-compare
|
||||
-Wstringop-overflow
|
||||
-Wstringop-overflow=4
|
||||
@@ -479,8 +487,8 @@ Note: Some modern features (like C++20 ranges or filesystem support) may be disa
|
||||
-Wunreachable-code
|
||||
-Wunsafe-loop-optimizations
|
||||
-Wunused
|
||||
-Wunused-but-set-parameter
|
||||
-Wunused-but-set-variable
|
||||
-Wunused-but-set-parameter=3
|
||||
-Wunused-but-set-variable=3
|
||||
-Wunused-const-variable=2
|
||||
-Wunused-function
|
||||
-Wunused-label
|
||||
@@ -517,7 +525,7 @@ The library has no prerequisites other than the Standard Template Library (STL).
|
||||
|
||||
- The library is compiled and tested with both [libc++](https://libcxx.llvm.org) and [libstdc++](https://gcc.gnu.org/onlinedocs/libstdc++/) to detect subtle differences or incompatibilities.
|
||||
- The code checked with [Include What You Use (IWYU)](https://include-what-you-use.org) that all required standard headers are included.
|
||||
- On Windows, the library is compiled with `<Windows.h>` being included to detect and avoid common bugs.
|
||||
- On Windows, the library is compiled with `<Windows.h>` being included to detect and avoid common bugs (see [`unit-windows_h.cpp`](https://github.com/nlohmann/json/blob/develop/tests/src/unit-windows_h.cpp)).
|
||||
- The library is compiled with exceptions disabled to support alternative means of error handling.
|
||||
|
||||
## Stable public API
|
||||
@@ -560,12 +568,18 @@ The code is checked with state-of-the-art static code analysis tools.
|
||||
Clang-Tidy configuration (.clang-tidy)
|
||||
|
||||
```
|
||||
# TODO: The first three checks are only removed to get the CI going. They have to be addressed at some point.
|
||||
# TODO: portability-avoid-pragma-once: should be fixed eventually
|
||||
# bugprone-use-after-move (hicpp-invalid-access-moved is its alias) still flags
|
||||
# the basic_json move constructor, which forwards the whole object to its base
|
||||
# class (#5724), and two forwards in the error-message construction of
|
||||
# at(KeyType&&) (json.hpp, both overloads: find(std::forward<KeyType>(key))
|
||||
# followed by string_t(std::forward<KeyType>(key)) in the throw), which #5689
|
||||
# rewrites. Re-enable both checks once those changes have landed.
|
||||
# portability-avoid-pragma-once: kept disabled on purpose. #pragma once is accepted
|
||||
# by every supported compiler, and tools/amalgamate/amalgamate.py strips it from
|
||||
# single_include, so there is nothing left to fix here.
|
||||
|
||||
Checks: '*,
|
||||
|
||||
-portability-template-virtual-member-function,
|
||||
-bugprone-use-after-move,
|
||||
-hicpp-invalid-access-moved,
|
||||
|
||||
@@ -599,7 +613,6 @@ The code is checked with state-of-the-art static code analysis tools.
|
||||
-google-readability-function-size,
|
||||
-google-runtime-float,
|
||||
-google-runtime-int,
|
||||
-google-runtime-references,
|
||||
-hicpp-avoid-goto,
|
||||
-hicpp-explicit-conversions,
|
||||
-hicpp-function-size,
|
||||
@@ -633,6 +646,7 @@ The code is checked with state-of-the-art static code analysis tools.
|
||||
-readability-magic-numbers,
|
||||
-readability-redundant-access-specifiers,
|
||||
-readability-redundant-parentheses,
|
||||
-readability-redundant-typename,
|
||||
-readability-simplify-boolean-expr,
|
||||
-readability-uppercase-literal-suffix,
|
||||
-readability-use-concise-preprocessor-directives'
|
||||
@@ -640,10 +654,13 @@ The code is checked with state-of-the-art static code analysis tools.
|
||||
CheckOptions:
|
||||
- key: hicpp-special-member-functions.AllowSoleDefaultDtor
|
||||
value: 1
|
||||
# clang-tidy 22.1 extended this check to classes and enums; the test files
|
||||
# define many such helper types at namespace scope, which is harmless
|
||||
- key: misc-use-internal-linkage.AnalyzeTypes
|
||||
value: false
|
||||
|
||||
WarningsAsErrors: '*'
|
||||
|
||||
#HeaderFilterRegex: '.*nlohmann.*'
|
||||
HeaderFilterRegex: '.*hpp$'
|
||||
```
|
||||
|
||||
|
||||
Reference in new issue
Block a user