cmake: disable pedantic
authorPaul Donald <[email protected]>
Sat, 25 Oct 2025 16:24:35 +0000 (18:24 +0200)
committerÁlvaro Fernández Rojas <[email protected]>
Mon, 3 Nov 2025 13:46:06 +0000 (14:46 +0100)
This flag breaks compilation with ubus on aarch64/arm/x86.
The only platform which compiles successfully is mips.

/home/runner/work/odhcp6c/odhcp6c/build/include/libubox/utils.h:126:31: error: invalid application of ‘sizeof’ to a void type [-Werror=pointer-arith]
  126 |         (sizeof(int) == sizeof(*(1 ? ((void*)((long)(x) * 0l)) : (int*)1)))
      |                               ^
/home/runner/work/odhcp6c/odhcp6c/build/include/libubox/utils.h:140:31: note: in expansion of macro ‘__is_constant’
  140 |         __builtin_choose_expr(__is_constant(x),                         \
      |                               ^~~~~~~~~~~~~
/home/runner/work/odhcp6c/odhcp6c/build/include/libubox/utils.h:167:24: note: in expansion of macro ‘__eval_safe’
  167 | #define be32_to_cpu(x) __eval_safe(__constant_swap32, x)
      |                        ^~~~~~~~~~~

Signed-off-by: Paul Donald <[email protected]>
Link: https://github.com/openwrt/odhcp6c/pull/109
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
CMakeLists.txt

index c4c8c2ba990584fb6fb07553134c36790b4e84f8..2db50ccc4d007169d3e297f80cec17bc1ef88397 100644 (file)
@@ -20,7 +20,6 @@ target_compile_options(${PROJECT_NAME} PRIVATE -g3)
 target_compile_options(${PROJECT_NAME} PRIVATE -Os)
 target_compile_options(${PROJECT_NAME} PRIVATE -Wall)
 target_compile_options(${PROJECT_NAME} PRIVATE -Werror)
-target_compile_options(${PROJECT_NAME} PRIVATE -pedantic)
 target_compile_options(${PROJECT_NAME} PRIVATE -Wextra)
 target_compile_options(${PROJECT_NAME} PRIVATE -Werror=implicit-function-declaration)
 target_compile_options(${PROJECT_NAME} PRIVATE -Wformat)