diff --git a/CMakeLists.txt b/CMakeLists.txt index f770602..1404764 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ set(libucore_VERSION ${libucore_VERSION_MAJOR}.${libucore_VERSION_MINOR}.${libuc set(CMAKE_VERBOSE_MAKEFILE ON) -set(CMAKE_C_STANDARD 11) +set(CMAKE_C_STANDARD 17) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wundef -Wcast-qual -Wshadow -Wcast-align -pipe -Wno-unused-parameter -Werror=implicit-function-declaration -Winit-self") add_definitions(-D_FILE_OFFSET_BITS=64) set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -O2") @@ -30,13 +30,14 @@ if (CODE_COVERAGE) set(build_type "${build_type}-coverage") endif() +add_compile_definitions($<$:DEBUG>) option(BUILD_SANITIZE "build with address sanitizer" OFF) if (BUILD_SANITIZE) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address") set(build_type "${build_type}-sanitize") endif() - - +find_package(PkgConfig REQUIRED) +pkg_check_modules(CHECK REQUIRED IMPORTED_TARGET check) include_directories(include) add_subdirectory(src) diff --git a/include/ucore/sarena.h b/include/ucore/sarena.h index ed4f09a..afffc96 100644 --- a/include/ucore/sarena.h +++ b/include/ucore/sarena.h @@ -25,9 +25,9 @@ extern "C" { */ typedef struct UCSArena UCSArena; struct UCSArena { - char *start; // start of user buffer - char *curr; // next alloc point - char *end; // one past end of user buffer + unsigned char *start; // start of user buffer + unsigned char *curr; // next alloc point + unsigned char *end; // one past end of user buffer }; /** Initialize a UCSArena with predefined backing array. diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6e9f79b..e771441 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,6 +1,6 @@ file(GLOB TEST_SOURCE_FILES test_*.c) -link_libraries(check ucore Threads::Threads) +link_libraries(ucore Threads::Threads PkgConfig::CHECK) if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") include_directories("/opt/homebrew/include") link_directories("/opt/homebrew/lib")