laurencelundblade / QCBOR

Comprehensive, powerful, commercial-quality CBOR encoder/ decoder that is still suited for small devices.
Other
183 stars 47 forks source link

INT64_MIN encoding so static analyzers don't complain #171

Closed laurencelundblade closed 1 year ago

laurencelundblade commented 1 year ago

This change is primarily so static analyzers don't complain. There is, and has been, test coverage for this condition for years with no reported failures. Probably QCBOR has been run on many different OS's, CPUs and with many different compilers.

This change is explicit about the application of the offset of 1 for encoding negative integers to avoid undefined behavior when encoding INT64_MIN.