#1097928 squidguard: ftbfs with GCC-15

Package:
src:squidguard
Source:
src:squidguard
Submitter:
Matthias Klose
Date:
2026-05-22 19:13:02 UTC
Severity:
normal
Tags:
#1097928#5
Date:
2025-02-17 17:54:56 UTC
From:
To:
[This bug is NOT targeted to the upcoming trixie release]

Please keep this issue open in the bug tracker for the package it
was filed for.  If a fix in another package is required, please
file a bug for the other package (or clone), and add a block in this
package. Please keep the issue open until the package can be built in
a follow-up test rebuild.

The package fails to build in a test rebuild on at least amd64 with
gcc-15/g++-15, but succeeds to build with gcc-14/g++-14. The
severity of this report will be raised before the forky release.

The full build log can be found at:
http://qa-logs.debian.net/2025/02/16/amd64exp/squidguard_1.6.0-6_unstable_gccexp.log.gz
The last lines of the build log are at the end of this report.

To build with GCC 15, either set CC=gcc-15 CXX=g++-15 explicitly,
or install the gcc, g++, gfortran, ... packages from experimental.

  apt-get -t=experimental install g++

GCC 15 now defaults to the C23/C++23 standards, exposing many FTBFS.
Other Common build failures are new warnings resulting in build failures
with -Werror turned on, or new/dropped symbols in Debian symbols files.
For other C/C++ related build failures see the porting guide at
http://gcc.gnu.org/gcc-15/porting_to.html

[...]
checking for unistd.h... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for db.h... yes
checking for regex.h... yes
checking for unistd.h... (cached) yes
checking for db.h... (cached) yes
checking suppress runtime logging... yes
checking syslog for logging... no
checking squid runtime user ... squid
checking for ldap_init in -lldap... yes
checking for ldap support... yes
checking for mysql support... no
checking for pthread_create in -lpthread... yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for regcomp... yes
checking for regerror... yes
checking for regexec... yes
checking for strdup... yes
checking for strerror... yes
checking for vsnprintf... yes
checking for sigaction... yes
checking for signal... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/main.c
config.status: creating src/sgLog.c
config.status: creating src/sgDiv.c
config.status: creating src/sg.h
config.status: creating src/sg.y
config.status: creating test/Makefile
config.status: creating test/test1.conf
config.status: creating test/test2.conf
config.status: creating samples/Makefile
config.status: creating samples/sample.conf
config.status: creating samples/squidGuard.cgi
config.status: creating samples/squidGuard-simple.cgi
config.status: creating samples/squidGuard-simple-de.cgi
config.status: creating contrib/Makefile
config.status: creating contrib/squidGuardRobot/squidGuardRobot
config.status: creating contrib/sgclean/sgclean
config.status: creating contrib/hostbyname/hostbyname
config.status: creating src/config.h
make[1]: Leaving directory '/build/reproducible-path/squidguard-1.6.0'
   dh_auto_build -O--no-parallel
	make -j1
make[1]: Entering directory '/build/reproducible-path/squidguard-1.6.0'
making all in squidguard-1.6.0
make[2]: Entering directory '/build/reproducible-path/squidguard-1.6.0/src'
making all in src
gcc -I.. -I. -I. -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include -I/usr/include -DHAVE_CONFIG_H -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/squidguard-1.6.0=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -DLDAP_DEPRECATED -I/usr/include -I/usr/include -c main.c
gcc -I.. -I. -I. -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include -I/usr/include -DHAVE_CONFIG_H -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/squidguard-1.6.0=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -DLDAP_DEPRECATED -I/usr/include -I/usr/include -c sgLog.c
gcc -I.. -I. -I. -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include -I/usr/include -DHAVE_CONFIG_H -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/squidguard-1.6.0=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -DLDAP_DEPRECATED -I/usr/include -I/usr/include -c sgDb.c
sgDb.c:30:6: error: conflicting types for ‘sgDbInit’; have ‘void(struct sgDb *, char *)’
   30 | void sgDbInit(struct sgDb *Db, char *file)
      |      ^~~~~~~~
In file included from sgDb.c:19:
sg.h:434:8: note: previous declaration of ‘sgDbInit’ with type ‘void(void)’
  434 | void   sgDbInit __P(());
      |        ^~~~~~~~
make[2]: *** [Makefile:71: sgDb.o] Error 1
make[2]: Leaving directory '/build/reproducible-path/squidguard-1.6.0/src'
make[1]: *** [Makefile:34: all] Error 1
make[1]: Leaving directory '/build/reproducible-path/squidguard-1.6.0'
dh_auto_build: error: make -j1 returned exit code 2
make: *** [debian/rules:11: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2

#1097928#14
Date:
2025-09-21 13:08:35 UTC
From:
To:
Control: tags -1 patch
thanks

I have just confirmed that the patches at
<https://src.fedoraproject.org/rpms/squidGuard/c/0dadeebd5fc3a6efae2666989e1ec545fe4fc02a?branch=rawhide>
or
<https://build.opensuse.org/projects/openSUSE:Factory/packages/squidGuard/files/fix-build-gcc15.patch?expand=1>
resolve the FTBFS.

HTH,
Flo

#1097928#21
Date:
2026-05-22 19:11:37 UTC
From:
To:
Dear maintainer,

I have prepared an NMU for squidguard (versioned as 1.6.0-6.1). The diff
is attached to this message.

I require a sponsor to have it uploaded.

Regards.

diffstat for squidguard-1.6.0 squidguard-1.6.0

 changelog                        |    9 +++++++++
 patches/12_fix-ftbfs-gcc15.patch |   39 +++++++++++++++++++++++++++++++++++++++
 patches/series                   |    1 +
 3 files changed, 49 insertions(+)

diff -Nru squidguard-1.6.0/debian/changelog squidguard-1.6.0/debian/changelog
--- squidguard-1.6.0/debian/changelog 2024-04-04 03:25:49.000000000 +0530
+++ squidguard-1.6.0/debian/changelog 2026-05-23 00:00:00.000000000 +0530
@@ -1,3 +1,12 @@
+squidguard (1.6.0-6.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Patch src/sg.h.in:
+    - Fix FTBFS with GCC-15 by giving sgAlarm and sgDbInit real
+      prototypes. Closes: #1097928
+
+ -- Azeez Syed <azeezalishah@gmail.com>  Sat, 23 May 2026 00:00:00 +0530
+
 squidguard (1.6.0-6) unstable; urgency=medium

   * debian/control:
diff -Nru squidguard-1.6.0/debian/patches/12_fix-ftbfs-gcc15.patch
squidguard-1.6.0/debian/patches/12_fix-ftbfs-gcc15.patch
--- squidguard-1.6.0/debian/patches/12_fix-ftbfs-gcc15.patch
1970-01-01 05:30:00.000000000 +0530
+++ squidguard-1.6.0/debian/patches/12_fix-ftbfs-gcc15.patch
2026-05-23 00:00:00.000000000 +0530
@@ -0,0 +1,39 @@
+Description: Fix FTBFS with GCC-15 due to C23 empty parameter list semantics
+ GCC-15 defaults to C23, where an empty parameter list "()" in a function
+ declaration means "(void)" rather than the historical "unspecified
+ parameters". The __P(()) macro in sg.h.in therefore conflicts with two
+ function definitions that take real arguments, causing build failures:
+ .
+   sgDb.c:30: error: conflicting types for 'sgDbInit';
+     have 'void(struct sgDb *, char *)'
+   sg.h:434: note: previous declaration with type 'void(void)'
+ .
+ Align the declarations of sgAlarm and sgDbInit with their definitions.
+ The same two-line change is shipped by Fedora rawhide and openSUSE
+ Factory.
+Author: Azeez Syed <azeezalishah@gmail.com>
+Bug-Debian: https://bugs.debian.org/1097928
+Origin: vendor,
https://src.fedoraproject.org/rpms/squidGuard/c/0dadeebd5fc3a6efae2666989e1ec545fe4fc02a
+Forwarded: no
+Last-Update: 2026-05-23
+---
+diff -urN s11/src/sg.h.in s12/src/sg.h.in
+--- s11/src/sg.h.in 2019-02-02 18:00:40.000000000 +0100
++++ s12/src/sg.h.in 2026-05-23 00:00:00.000000000 +0000
+@@ -360,7 +360,7 @@ char   *sgStripUrl __P((char *));
+ void   sgEmergency __P(());
+ void   sgReloadConfig __P(());
+ void   sgHandlerSigHUP __P((int));
+-void   sgAlarm __P(());
++void   sgAlarm __P((int));
+ int    sgStrRcmp __P((char *, char *));
+ int    sgStrRncmp __P((char *, char *, int));
+ int    sgDomStrRncmp __P((char *, char *, int));
+@@ -431,7 +431,7 @@ void   sgFreePatternBuffer __P((struct s
+ int    sgRegExpMatch __P((struct sgRegExp *, char *));
+ char   *sgRegExpSubst __P((struct sgRegExp *, char *));
+
+-void   sgDbInit __P(());
++void   sgDbInit __P((struct sgDb *, char *));
+ void   sgDbLoadTextFile __P((struct sgDb *, char *, int));
+ void   sgDbUpdate __P((struct sgDb *, char *, char *, size_t));
diff -Nru squidguard-1.6.0/debian/patches/series
squidguard-1.6.0/debian/patches/series
--- squidguard-1.6.0/debian/patches/series 2024-04-04 03:07:15.000000000 +0530
+++ squidguard-1.6.0/debian/patches/series 2026-05-22 22:01:20.000000000 +0530
@@ -1,2 +1,3 @@
 10_fix-ftbfs-for-gcc10.patch
 11_fix-configure-check.patch
+12_fix-ftbfs-gcc15.patch