Skip to content

Commit 10a3dc5

Browse files
committed
Fix build on FreeBSD.
Now that FreeBSD has imported LLVM15, new errors are flagged. Ideally the code that implicily converts integers should be fixed but a first step is to use a compiler option that ignores the errors like prior versions of LLVM and GCC do. Additionaly, as in Linux, read_common_sizet() is also undefined in FreeBSD.
1 parent 7111011 commit 10a3dc5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ if (MSVC)
516516
endif()
517517

518518
if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
519-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -W -Wall -Wnonnull -Wshadow -Wformat -Wundef -Wno-unused-parameter -Wmissing-prototypes -Wno-unknown-pragmas -D_GNU_SOURCE -std=c99")
519+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -W -Wall -Wnonnull -Wshadow -Wformat -Wundef -Wno-unused-parameter -Wmissing-prototypes -Wno-unknown-pragmas -Wno-int-conversion -D_GNU_SOURCE -std=c99")
520520
endif()
521521
if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
522522
add_link_options(-lkvm -lm -lprocstat)

src/common/memusage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
#include "memusage.h"
5757
#include "bfind.h"
5858

59-
#if defined(OS_LINUX)
59+
#if defined(OS_LINUX) || defined(__FreeBSD__)
6060
static int read_common_sizet(void *szp, char *strval)
6161
{
6262
char *end;

0 commit comments

Comments
 (0)