From: Lennart Poettering Date: Fri, 12 Nov 2021 09:17:07 +0000 (+0100) Subject: docs: clarify the assumption on numeric values of JSON parsers we make X-Git-Tag: v250-rc1~204 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=14efbfd96d67800e55137f89ec7a09d81049d176;p=thirdparty%2Fsystemd.git docs: clarify the assumption on numeric values of JSON parsers we make Prompted by: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/BOBD6KVTXPR6K5ANAX6LIJLKNSGXCR3B/ --- diff --git a/docs/COREDUMP_PACKAGE_METADATA.md b/docs/COREDUMP_PACKAGE_METADATA.md index e34abbd1478..705d5d695aa 100644 --- a/docs/COREDUMP_PACKAGE_METADATA.md +++ b/docs/COREDUMP_PACKAGE_METADATA.md @@ -67,6 +67,16 @@ Value: a JSON string with the structure described below } ``` +When it comes to JSON numbers, this specification assumes that JSON parsers +processing this information are capable of reproducing the full signed 53bit +integer range (i.e. -2⁵³+1…+2⁵³-1) as well as the full 64bit IEEE floating +point number range losslessly (with the exception of NaN/-inf/+inf, since JSON +cannot encode that), as per recommendations of +[RFC8259](https://datatracker.ietf.org/doc/html/rfc8259#page-8). Fields in +these JSON objects are thus permitted to encode numeric values from these +ranges as JSON numbers, and should not use numeric values not covered by these +types and ranges. + A reference implementations of a [build-time tool is provided](https://github.com/systemd/package-notes) and can be used to generate a linker script, which can then be used at build time via ```LDFLAGS="-Wl,-T,/path/to/generated/script"``` to include the note in the binary.