This repository has been archived on 2026-09-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Thiago Macieira d0a6def07b CBOR-to-JSON: fix UB in converting out-of-bounds FP to integer
Both the C and C++ standards say it is Undefined Behavior to convert a
floating point number to integer if the input is out of bounds of the
destination type.

And indeed this started failing in recent builds, with
  val = 18446744073709551616  (2^64)
it has probably been producing ival = 18446744073709551615 for a while,
but the conversion back to floating point now rounded up and compared
equal to the input.

So let's just fix it.

Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
2025-03-12 19:35:44 -07:00
2025-03-12 16:49:17 -07:00
2025-03-12 16:49:17 -07:00
2016-08-04 14:25:32 -07:00
2018-02-07 10:40:52 -08:00
2017-07-26 10:29:17 -07:00
2017-12-06 18:25:51 -08:00
2021-09-03 11:56:36 -07:00

Concise Binary Object Representation (CBOR) Library
---------------------------------------------------

To build TinyCBOR:

  make

If you want to change the compiler or pass extra compiler flags:

  make CC=clang CFLAGS="-m32 -Oz" LDFLAGS="-m32"

Documentation: https://intel.github.io/tinycbor/current/

S
Description
[ARCHIVE] GOLEM lab historic — frozen 2026-09-06
Readme MIT
891 KiB
Languages
C 50.3%
C++ 45.9%
CMake 2.1%
Perl 1.3%
Shell 0.3%
Other 0.1%