Control: tags -1 + fixed-upstream

On Tue, Dec 30, 2025 at 08:20:36AM +0100, Andreas Henriksson wrote:
> On Tue, Dec 30, 2025 at 09:35:58AM +1100, Craig Small wrote:
> [...]
> > syslog-ng: How is pages this due to net-snmp?
> > 
> > 
> > ./../lib/filterx/filterx-object.h:221:3: error: ISO C90 forbids mixed
> > declarations and code [-Werror=declaration-after-statement]
> >   221 |   FilterXObject *result = self->type->getattr(self, attr);
> >       |   ^~~~~~~~~~~~~
> 
> It seems `net-snmp-config --cflags` changed its output and I think the
> culprit is that it now includes: -Werror=declaration-after-statement

Confirmed this upstream change fixes syslog-ng build:
https://github.com/net-snmp/net-snmp/commit/0f19435ecc8fd6c3ef9cf2a391bd7bca25539e80.patch

(Commit does not apply cleanly but second hunk only adds a new blank line, so
I dropped that. Modified patch attached for your convenience.)

Regards,
Andreas Henriksson
>From 0f19435ecc8fd6c3ef9cf2a391bd7bca25539e80 Mon Sep 17 00:00:00 2001
From: Wes Hardaker <[email protected]>
Date: Mon, 29 Dec 2025 13:38:59 -0800
Subject: [PATCH] moving -Werror=declaration-after-statement to only for
 developers

---
 configure.d/config_os_progs | 38 +++++++++++++++++++------------------
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/configure.d/config_os_progs b/configure.d/config_os_progs
index 71e87165a6..6e97d1a13b 100644
--- a/configure.d/config_os_progs
+++ b/configure.d/config_os_progs
@@ -89,24 +89,6 @@ AC_SUBST([PERL_SYSTEM_INVOKES_POSIX_SHELL])
 #   Build environment:
 ##
 
-for opt in -Werror=declaration-after-statement
-do
-    AC_MSG_CHECKING([whether the compiler supports $opt])
-    netsnmp_save_CFLAGS="$CFLAGS"
-    if test x$opt != x-Wstrict-prototypes; then
-      CFLAGS="-Werror $opt $CFLAGS"
-    else
-      CFLAGS="$opt $CFLAGS"
-    fi
-    AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [
-      AC_MSG_RESULT([yes])
-      CFLAGS="$opt $netsnmp_save_CFLAGS"
-    ], [
-      AC_MSG_RESULT([no])
-      CFLAGS="$netsnmp_save_CFLAGS"
-    ])
-done
-
 #   developer build 
 #       (enabled by default when building from SVN checkout)
 #
@@ -138,6 +121,25 @@ if test "x$developer" = "xyes" -a "x$GCC" = "xyes"; then
       CFLAGS="$netsnmp_save_CFLAGS"
     done
     AC_MSG_RESULT($DEVFLAGS)
+
+    for opt in -Werror=declaration-after-statement
+    do
+        AC_MSG_CHECKING([whether the compiler supports $opt])
+        netsnmp_save_CFLAGS="$CFLAGS"
+        if test x$opt != x-Wstrict-prototypes; then
+          CFLAGS="-Werror $opt $CFLAGS"
+        else
+          CFLAGS="$opt $CFLAGS"
+        fi
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [
+          AC_MSG_RESULT([yes])
+          CFLAGS="$opt $netsnmp_save_CFLAGS"
+        ], [
+          AC_MSG_RESULT([no])
+          CFLAGS="$netsnmp_save_CFLAGS"
+        ])
+    done
+
 else
     DEVFLAGS=""
 fi

Reply via email to