2536 Commits

Author SHA1 Message Date
Takatoshi Kondo
b3de6f83cb
Merge pull request #1053 from redboltz/unify_project_name_c
Unify all package related names to msgpack-c.
2023-03-04 21:35:08 +09:00
Takatoshi Kondo
01f3d24fee Unify all package related names to msgpack-c.
Update the version to 6.0.0.
2023-02-28 10:49:13 +09:00
Takatoshi Kondo
551308ae10
Merge pull request #1049 from redboltz/fix_makedist.sh
Fixed cmake config name.
c-5.0.0
2023-01-10 21:41:34 +09:00
Takatoshi Kondo
f2c446799c Fixed cmake config name. 2023-01-10 20:06:01 +09:00
Takatoshi Kondo
c2430635f9
Merge pull request #1047 from redboltz/update_to_500_c
Updated the version to 5.0.0.
2023-01-10 19:58:15 +09:00
Takatoshi Kondo
bffd3f2091 Updated the version to 5.0.0. 2023-01-10 18:50:20 +09:00
Takatoshi Kondo
076b5ed7fd
Merge pull request #1044 from traversaro/patch-1
Change CMake package name of C library to msgpackc
2023-01-10 18:32:20 +09:00
Silvio Traversaro
52fa74804c
Update CMakeLists.txt 2023-01-10 10:02:33 +01:00
Silvio Traversaro
5ae6077234
Update appveyor.yml 2023-01-07 14:40:24 +01:00
Silvio Traversaro
43de525dc7
Update zlib used in AppVeyor to 1.2.13 2023-01-07 13:35:33 +01:00
Silvio Traversaro
f7961b798b
Change CMake package name to msgpackc 2023-01-05 14:59:10 +01:00
Silvio Traversaro
5cada9eb27
Update and rename msgpack-config.cmake.in to msgpackc-config.cmake.in 2023-01-05 14:55:45 +01:00
Silvio Traversaro
ce42436f20
Change CMake package name to msgpackc 2023-01-05 14:55:10 +01:00
Takatoshi Kondo
c3df1bb26e
Merge pull request #1023 from redboltz/add_sanitizer
Added additional address sanitizer for CI.
2022-06-05 21:15:26 +09:00
Takatoshi Kondo
63d3b093f0 Updated appveyor zlib version. 2022-06-05 20:35:54 +09:00
Takatoshi Kondo
8b57d2caf9 Added additional address sanitizer for CI.
Except install, and except SHARED=OFF.
2022-06-05 20:30:14 +09:00
Takatoshi Kondo
a9a48cea3a
Merge pull request #976 from redboltz/update_to_c_4
Updated the version to 4.0.0.
c-4.0.0
2021-09-01 11:10:58 +09:00
Takatoshi Kondo
e96853a946 Updated the version to 4.0.0. 2021-09-01 10:50:27 +09:00
Takatoshi Kondo
2ebe884c0e
Merge pull request #962 from jrtc27/c-cheri
Support building for CHERI/Morello
2021-08-17 14:20:42 +09:00
Jessica Clarke
823caa8d8c Increase portability by masking rather than dividing and multiplying pointers
If (u)intptr_t exist, the only guarantee provided by the C standard is
that you can cast a pointer to one and back. No claims are made about
what that injective pointer-to-integer mapping is, nor the surjective
reverse integer-to-pointer mapping; for example, nowhere is it specified
that, given a char *p, p + 1 == (char *)((uintptr_t)p + 1), although no
sensible implementation would make that not the case (provided p is a
valid strictly in bounds pointer).

With real pointers, taking them out of bounds (other than the one
exception that is a one-past-the-end pointer) of their corresponding
allocation is UB. Whilst the semantics of arithmetic on uintptr_t is not
specified when cast back to a pointer, compilers already assume that
uintptr_t arithmetic does not go out of bounds (or, put another way,
that the result always ends up pointing to the same allocation) and
their alias analysis-based optimisations already assume this. CHERI, and
Arm's Morello, implement C language pointers with hardware capabilities,
which are unforgeable pointers with bounds and permissions. In order to
only double rather than quadruple the size of pointers, CHERI exploits
C's requirement that pointers not be taken out of bounds, and compresses
these bounds using a floating-point-like representation. The important
implication of this for most software is that if a capability, i.e. C
pointer in CHERI C, is taken too far out of bounds (where "too far" is
proportional to the size of the allocation) it can no longer be
represented and thus is invalidated, meaning it will trap on a later
dereference. This also extends to (u)intptr_t, which are also
implemented as capabilities, since if it were just a plain integer then
casting a pointer to (u)intptr_t would lose the metadata and break the
ability to cast back to a pointer.

Whilst the composition of dividing a pointer and then multiplying it
again has a somewhat sensible interpretation of rounding it down (even
though technically no such guarantees are made by the spec), the
individual operations do not, and the division is highly likely to take
the pointer far out of bounds of its allocation and, on CHERI, result in
it being unrepresentable and thus invalidated. Instead, we can perform a
more standard bitwise AND with a mask to clear the low bits, exploiting
the fact that alignments are powers of two; note that technically the
rounding up variant of this does take the pointer out of bounds slightly
and, whilst there are other ways to write such code that avoid doing so,
they are more cumbersome, and this code does not need to worry about
that.
2021-08-07 00:19:46 +01:00
Jessica Clarke
9c5654ed44 Increase portability by using uintptr_t rather than size_t for pointers
The only integral types guaranteed by the C standard, if they exist, to
support having a pointer cast to them and back are (u)intptr_t. On most
architectures, size_t and uintptr_t are typedefs for the same underlying
type, so this code ends up working. However, on CHERI, and thus Arm's
experimental Morello prototype, C language pointers are implemented with
hardware capabilities, which are unforgeable pointers with bounds and
permissions. This means that, whilst size_t remains a plain 32/64-bit
integer size, (u)intotr_t is represented with a capability. Casting to
size_t and back to a pointer causes the capability metadata to be lost
and the resulting capability to be invalid, meaning it will trap when
dereferenced. Instead, use uintptr_t, and provide fallback definitions
for old versions of MSVC like for the other C99 integer types.
2021-08-06 23:49:16 +01:00
Takatoshi Kondo
5d30e42c01
Merge pull request #953 from kovdan01/fix_name_conflicts_c
Fix name conflicts (C)
2021-05-09 12:12:18 +09:00
Daniil Kovalev
6b4a7b3b16 Fix iovec-related tests 2021-05-08 17:58:09 +03:00
Daniil Kovalev
0f1d0ed78c Fix name conflicts (C version)
Same as #952, but for C
2021-05-08 16:51:02 +03:00
Takatoshi Kondo
825017ac50
Merge pull request #949 from redboltz/fix_948
Fixed #948.
2021-04-24 15:41:02 +09:00
Takatoshi Kondo
4bc64de0ec Fixed #948.
Added msgpack_unpacked_destroy() call.
2021-04-24 15:25:37 +09:00
Takatoshi Kondo
08a42a347c
Merge pull request #944 from vmallet/ctests_verbose
C: Increase tests visibility (Issue #943)
2021-04-03 09:39:06 +09:00
Takatoshi Kondo
734e47c067
Merge pull request #942 from vmallet/fix_print_buffer_empty_str
Fix #941: empty strings break msgpack_object_print_buffer() (C)
2021-04-03 09:23:26 +09:00
Vincent Mallet
fa7bb8ec77 README: make reference to gtest 2021-03-23 17:05:54 -07:00
Vincent Mallet
dc51f5d236 Better visibility for C tests:
- turn on output-on-failure by default
 - explain how to run tests in README
2021-03-23 16:33:52 -07:00
Vincent Mallet
f06b46d412 Attempt to fix Windows build for tests.
Use sprintf_s (windows) or snprintf (others) instead of sprintf in unit tests.
2021-03-23 14:57:07 -07:00
Vincent Mallet
1c97e051ad Fixes #941
Don't abort serialization when running into empty strings in msgpack_object_print_buffer().
Added a couple of unit tests to test empty string cases.
2021-03-23 13:56:03 -07:00
Takatoshi Kondo
4f59b98185
Merge pull request #899 from redboltz/fix_buffer_ptr_size
Fix buffer ptr size
2020-07-03 19:42:50 +09:00
Takatoshi Kondo
208ec65034 Set -fsanitize=undefined on CI.
Propagate CXXFLAGS correctly.
Set CFLAGS in the same way.
2020-07-03 09:30:05 +09:00
Takatoshi Kondo
3bd0172a9a Unified NULL buf handling for all *buffer.
*buffer means sbuffer, zbuffer, fbuffer, and vrefbuffer.

The logic is as follows:

if buf is NULL
   if len is 0
      do nothing return 0 (success)
   else
      assertion fail
else
   set contants to *buffer
2020-07-03 09:18:00 +09:00
Takatoshi Kondo
3bb121fb8f
Merge pull request #890 from ygj6/c_master
check null pointer before using memcpy()
2020-07-01 18:25:08 +09:00
yuangongji
fd9e377bac check null pointer before using memcpy() 2020-07-01 16:39:40 +08:00
Takatoshi Kondo
82ddfc1170
Merge pull request #885 from redboltz/fix_gha_badge_for_c
Replaced travis-ci badge with github actiond badge.
2020-06-12 12:29:26 +09:00
Takatoshi Kondo
6b195acba0 Replaced travis-ci badge with github actiond badge. 2020-06-12 11:36:41 +09:00
Takatoshi Kondo
ea1435784d
Merge pull request #877 from ygj6/c_master
remove C++ library in c_master branch
2020-06-08 09:25:43 +09:00
yuangongji
9eba7c482c remove C++ part in source code 2020-06-05 18:16:07 +08:00
yuangongji
9c6857c425 rename pack_template.h and sysdep.h
include/msgpack/pack_template.h => cmake/pack_template.h.in
include/msgpack/sysdep.h => cmake/sysdep.h.in

Use `git log --follow cmake/filename.h.in` to see full log
2020-06-05 16:09:17 +08:00
yuangongji
111b91a3e2 move exmple/c/* to example/
example/c/cmake/CMakeLists.txt => example/cmake/CMakeLists.txt
example/c/lib_buffer_unpack.c => example/lib_buffer_unpack.c
example/c/simple_c.c => example/simple_c.c
example/c/speed_test_uint32_array.c => example/speed_test_uint32_array.c
example/c/speed_test_uint64_array.c => example/speed_test_uint64_array.c
example/c/user_buffer_unpack.c => example/user_buffer_unpack.c

Use `git log --follow example/filename` to see full log
2020-06-05 16:09:17 +08:00
yuangongji
ee546036a1 remove C++ part files
remove the following files or folders:
erb
example/boost
example/cpp03
example/cpp11
example/x3
example/CMakeLists.txt
fuzz
include/msgpack/adaptor
include/msgpack/predef.h
include/msgpack/predef
include/msgpack/preprocessor
include/msgpack/v1
include/msgpack/v2
include/msgpack/v3
include/msgpack/*.hpp
include/msgpack.hpp
.gitmodules
external
make_file_list.sh
msgpack_vc8.sln
msgpack_vc8.vcproj
preprocess
QUICKSTART-CPP.md
test/*.cpp exclude test/*_c.cpp
.github/depends/boost.sh
ci/build_regression.sh
2020-06-05 16:09:17 +08:00
Takatoshi Kondo
6e7deb8091
Merge pull request #875 from redboltz/update_to_330
Update the version to 3.3.0.
cpp-3.3.0
2020-06-05 17:04:41 +09:00
Takatoshi Kondo
66fa561256 Update the version to 3.3.0. 2020-06-05 16:22:34 +09:00
Takatoshi Kondo
243fb27c3c
Merge pull request #874 from ygj6/build
fix cannot find boost error
2020-06-05 15:43:07 +09:00
yuangongji
746e983bf3 fix cannot find boost error 2020-06-01 20:02:52 +08:00
Takatoshi Kondo
766afb90ed
Merge pull request #870 from ygj6/json
convert between msgpack and json via cJSON library
2020-05-24 19:12:18 +09:00
yuangongji
403567c1c5 convert between msgpack and json 2020-05-24 17:24:55 +08:00