[med-svn] [Git][med-team/blimps][master] Fix FTBFS with gcc-15: build with -std=gnu17 (Closes: #1114069)

Andreas Tille (@tille) gitlab at salsa.debian.org
Sat Oct 17 20:29:02 BST 2026



Andreas Tille pushed to branch master at Debian Med / blimps


Commits:
ae3caf09 by Andreas Tille at 2026-10-17T21:28:37+02:00
Fix FTBFS with gcc-15: build with -std=gnu17 (Closes: #1114069)

* d/rules: build with -std=gnu17 to cope with gcc-15's default of C23
  mode, which the K&R code does not support.
* protomat-honour-build-flags.patch: new: build the protomat tools with
  the DEBCFLAGS/DEBLDFLAGS passed from the top Makefile instead of the
  hardcoded flags, so -std=gnu17 and the hardening flags apply to them.
* protomat-format-security.patch: new: use fputs() instead of
  fprintf(fout, line) with sequence data as the format string.
* p2clib-time_t.patch: new: use time_t for the result of time() in
  TimeStamp(), VAXdate() and VAXtime().

- - - - -


6 changed files:

- debian/changelog
- + debian/patches/p2clib-time_t.patch
- + debian/patches/protomat-format-security.patch
- + debian/patches/protomat-honour-build-flags.patch
- debian/patches/series
- debian/rules


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,22 @@
+blimps (3.9+ds-5) unstable; urgency=medium
+
+  * Team upload.
+  * d/rules: build with -std=gnu17 to cope with gcc-15's default of C23
+    mode, which the K&R code does not support. (Closes: #1114069)
+  * protomat-honour-build-flags.patch: new: make the protomat tools build
+    with the DEBCFLAGS/DEBLDFLAGS passed from the top Makefile instead of
+    the hardcoded "-Wall -O2 -c", so the -std=gnu17 and hardening flags
+    apply to them too.
+  * protomat-format-security.patch: new: don't use sequence data as a printf
+    format string in extract_seqs() and universa.c (fprintf -> fputs),
+    which failed to build with -Werror=format-security once protomat honours
+    the build flags.
+  * p2clib-time_t.patch: new: use time_t for the result of time() in
+    TimeStamp(), VAXdate() and VAXtime(), which is the wrong type (long) on
+    32-bit architectures with 64-bit time_t.
+
+ -- Andreas Tille <tille at debian.org>  Sat, 17 Oct 2026 21:30:00 +0200
+
 blimps (3.9+ds-4) unstable; urgency=medium
 
   * protect-protomat.patch: new: fix build failures in sift.


=====================================
debian/patches/p2clib-time_t.patch
=====================================
@@ -0,0 +1,38 @@
+Description: Use time_t for the time() result in p2clib
+ TimeStamp(), VAXdate() and VAXtime() pass a "long" to time(), localtime()
+ and ctime(). On 32-bit architectures with 64-bit time_t (e.g. armhf) this
+ is the wrong type: time() writes 8 bytes into a 4-byte variable, and gcc-15
+ rejects it with -Wincompatible-pointer-types. Use time_t.
+Author: Sebastien Bacher <seb128 at ubuntu.com>
+Forwarded: https://bugs.debian.org/1114069
+Last-Update: 2026-10-12
+---
+--- a/blimps/p2clib.c
++++ b/blimps/p2clib.c
+@@ -812,7 +812,7 @@ int *Day, *Month, *Year, *Hour, *Min, *S
+ {
+ #ifndef NO_TIME
+     struct tm *tm;
+-    long clock;
++    time_t clock;
+ 
+     time(&clock);
+     tm = localtime(&clock);
+@@ -830,7 +830,7 @@ int *Day, *Month, *Year, *Hour, *Min, *S
+ Void VAXdate(s)
+ char *s;
+ {
+-    long clock;
++    time_t clock;
+     char *c;
+     int i;
+     static int where[] = {8, 9, 0, 4, 5, 6, 0, 20, 21, 22, 23};
+@@ -846,7 +846,7 @@ char *s;
+ Void VAXtime(s)
+ char *s;
+ {
+-    long clock;
++    time_t clock;
+     char *c;
+     int i;
+ 


=====================================
debian/patches/protomat-format-security.patch
=====================================
@@ -0,0 +1,30 @@
+Description: Don't use sequence data as a printf format string
+ extract_seqs() wrote sequence lines with fprintf(fout, line), which
+ misbehaves if the data contains '%' and fails to build with
+ -Werror=format-security once protomat honours the build flags. Use fputs().
+Author: Sebastien Bacher <seb128 at ubuntu.com>
+Forwarded: https://bugs.debian.org/1114069
+Last-Update: 2026-10-09
+
+--- a/protomat/motmisc.c
++++ b/protomat/motmisc.c
+@@ -835,7 +835,7 @@ char *pros;
+                           if (strpbrk(&line[dbs[db]->seq_offset],
+                               "ARNDCQEGHILKMFPSTWYVBZXactg") != NULL)
+                           {
+-		             if (out) fprintf(fout, &line[dbs[db]->seq_offset]);
++		             if (out) fputs(&line[dbs[db]->seq_offset], fout);
+                              for (i=dbs[db]->seq_offset; i<strlen(line); i++)
+                                if (isalpha(line[i])) id->len = id->len + 1;
+                           }
+--- a/protomat/universa.c
++++ b/protomat/universa.c
+@@ -204,7 +204,7 @@ int short_title;
+ 	    {
+                for (i=0; i<strlen(line); i++)     /* change CR to space */
+                   if (line[i] == CR)  line[i] = ' ';
+-	       fprintf(fout, &line[dbs[db]->seq_offset]);
++	       fputs(&line[dbs[db]->seq_offset], fout);
+ 	    }  /*  end of sequence */
+ /*            if (!short_title) fprintf(fout, "\n");   was "*\n" */
+ 	 }  /*  end of start of entry */


=====================================
debian/patches/protomat-honour-build-flags.patch
=====================================
@@ -0,0 +1,23 @@
+Description: Build protomat tools with the build flags passed from the top Makefile
+ protomat/Makefile.Linux hardcodes "CFLAGS = -Wall -O2 -c", so the tools
+ (blksort, getblock, ...) were built without dpkg-buildflags (hardening,
+ -std=gnu17 to cope with gcc-15's C23 default, ...). Use DEBCFLAGS and
+ DEBLDFLAGS, which the top-level Makefile already passes, as is done for the
+ blimps directory.
+Author: Sebastien Bacher <seb128 at ubuntu.com>
+Forwarded: https://bugs.debian.org/1114069
+Last-Update: 2026-10-09
+
+--- a/protomat/Makefile.Linux
++++ b/protomat/Makefile.Linux
+@@ -2,8 +2,8 @@
+ #   Type "make install" to compile all programs and move them to ../bin
+ #   Type  "make blksort" to compile blksort program 
+ CC = gcc
+-CFLAGS = -Wall -O2 -c
+-LDFLAGS = -lm -o
++CFLAGS = $(DEBCFLAGS) -Wall -O2 -c
++LDFLAGS = $(DEBLDFLAGS) -lm -o
+ RM = /bin/rm -f
+ MV = /bin/mv -f
+ CP = cp -af


=====================================
debian/patches/series
=====================================
@@ -5,3 +5,6 @@ avoid_privacy_breach.patch
 fixup-implicit-function-declaration.patch
 more_gets.patch
 protect-protomat.patch
+protomat-honour-build-flags.patch
+protomat-format-security.patch
+p2clib-time_t.patch


=====================================
debian/rules
=====================================
@@ -4,8 +4,8 @@
 # export DH_VERBOSE=1
 
 export DEB_BUILD_MAINT_OPTIONS=hardening=+all
-# Workaround build failures with gcc-14.
-export DEB_CFLAGS_MAINT_APPEND=-Wno-error=implicit-int
+# Workaround build failures with gcc-14 and gcc-15 (C23 default, K&R code).
+export DEB_CFLAGS_MAINT_APPEND=-Wno-error=implicit-int -std=gnu17
 
 include /usr/share/dpkg/default.mk
 



View it on GitLab: https://salsa.debian.org/med-team/blimps/-/commit/ae3caf09838b4c93ef7c45c0effa0ec8354d7c69

-- 
View it on GitLab: https://salsa.debian.org/med-team/blimps/-/commit/ae3caf09838b4c93ef7c45c0effa0ec8354d7c69
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20261017/1beb56f9/attachment-0001.htm>


More information about the debian-med-commit mailing list