From ab2b4af2b627b1be4363f6372c032119c549a8d0 Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Wed, 29 Jul 2026 11:44:58 -0500 Subject: [PATCH 1/3] Fixed m4/cf3_gcc_flags.m4 to actually test compiler flags This was broken in CFE-3629 in commit fc40dd612d32139bee32e657b10fea82159999eb Ticket: ENT-14382 Changelog: none --- m4/cf3_gcc_flags.m4 | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/m4/cf3_gcc_flags.m4 b/m4/cf3_gcc_flags.m4 index 6eb9b75006..9aa3705f9e 100644 --- a/m4/cf3_gcc_flags.m4 +++ b/m4/cf3_gcc_flags.m4 @@ -48,38 +48,53 @@ if test x"$GCC" = "xyes" && test x"$HP_UX_AC" != x"yes"; then CF3_CFLAGS="$CF3_CFLAGS -std=gnu99 -g -Wall" AC_MSG_RESULT(yes) + dnl Save CFLAGS to restore after using it to test for compiler flag support + save_CFLAGS="$CFLAGS" AC_MSG_CHECKING(for -Wno-pointer-sign) + CFLAGS="-Wno-pointer-sign" AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main() {}])], [AC_MSG_RESULT(yes) CF3_CFLAGS="$CF3_CFLAGS -Wno-pointer-sign"], [AC_MSG_RESULT(no)]) AC_MSG_CHECKING(for -Werror=implicit-function-declaration) + CFLAGS="-Werror=implicit-function-declaration" AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main() {}])], [AC_MSG_RESULT(yes) CF3_CFLAGS="$CF3_CFLAGS -Werror=implicit-function-declaration"], [AC_MSG_RESULT(no)]) AC_MSG_CHECKING(for -Wunused-parameter) + CFLAGS="-Wunused-parameter" AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main() {}])], [AC_MSG_RESULT(yes) CF3_CFLAGS="$CF3_CFLAGS -Wunused-parameter"], [AC_MSG_RESULT(no)]) AC_MSG_CHECKING(for -Wno-incompatible-pointer-types) + CFLAGS="-Wno-incompatible-pointer-types" AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main() {}])], [AC_MSG_RESULT(yes) CF3_CFLAGS="$CF3_CFLAGS -Wno-incompatible-pointer-types"], [AC_MSG_RESULT(no)]) + dnl Clang does not like 'const const' construct arising from + dnl expansion of TYPED_SET_DECLARE macro + dnl + dnl This check is relying on explicit compilator detection due to + dnl GCC irregularities checking for -Wno-* command-line options + dnl (command line is not fully checked until actual warning occurs) AC_MSG_CHECKING(for -Wno-duplicate-decl-specifier) + CFLAGS="-Wno-duplicate-decl-specifier" AC_COMPILE_IFELSE([AC_LANG_SOURCE([#ifndef __clang__ -# GET_DIR_ERROR Not a clang +# error Not a clang #endif int main() {}])], [AC_MSG_RESULT(yes) CF3_CFLAGS="$CF3_CFLAGS -Wno-duplicate-decl-specifier"], [AC_MSG_RESULT(no)]) + dnl restore CFLAGS + CFLAGS="$save_CFLAGS" else AC_MSG_RESULT(no) fi From 807cc2376260e93dcb4b10f5a667c49d88e4007b Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Wed, 29 Jul 2026 11:54:04 -0500 Subject: [PATCH 2/3] bump copyright year in m4/cf3_gcc_flags.m4 --- m4/cf3_gcc_flags.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m4/cf3_gcc_flags.m4 b/m4/cf3_gcc_flags.m4 index 9aa3705f9e..2a43ef6bbb 100644 --- a/m4/cf3_gcc_flags.m4 +++ b/m4/cf3_gcc_flags.m4 @@ -1,5 +1,5 @@ # -# Copyright 2021 Northern.tech AS +# Copyright 2026 Northern.tech AS # # This file is part of CFEngine 3 - written and maintained by Northern.tech AS. # From 4ba68a4f41488c69fffdeaa691cdad0ea672f798 Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Thu, 30 Jul 2026 12:59:07 -0500 Subject: [PATCH 3/3] Use libntech branch with PR fix, delete this commit when libntech PR is merged --- libntech | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libntech b/libntech index b05a7a3d16..4ae2d60eb4 160000 --- a/libntech +++ b/libntech @@ -1 +1 @@ -Subproject commit b05a7a3d1664bbc5ec7b029071cb54a80154c925 +Subproject commit 4ae2d60eb4b1488b6c8c7088dbbb699bb0969d43