[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1109256: marked as done (libkpathsea-dev: redeclares Standard C functions with incompatible prototype, causing FTBFS elsewhere)



Your message dated Sun, 27 Jul 2025 23:59:36 +0000
with message-id <E1ugBHE-00HZR4-0D@fasolo.debian.org>
and subject line Bug#1109256: fixed in texlive-bin 2025.20250727.75242+ds-1
has caused the Debian Bug report #1109256,
regarding libkpathsea-dev: redeclares Standard C functions with incompatible prototype, causing FTBFS elsewhere
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
1109256: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1109256
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: libkpathsea-dev
Version: 2024.20240313.70630+ds-6
Severity: important
Tags: ftbfs upstream forky sid
Control: block 1096597 by -1
Control: affects -1 + src:evince

In #1096597, Matthias Klose reported that evince FTBFS with gcc-15 as 
default (it is not the default for trixie, but will become the default 
in forky). This seems to be caused by libkpathsea-dev's headers, 
combined with gcc-15 defaulting to C23.

As an example of the class of issue I'm reporting, libkpathsea-dev's 
c-std.h has this:

>#ifdef HAVE_STDLIB_H
>#include <stdlib.h>
>/* Include <stdlib.h> before <stddef.h>, to help avoid NULL
>   redefinitions on some systems.  (We don't include <stddef.h>
>   ourselves any more, but FYI.)  */
>#else
>/* It's impossible to say for sure what the system will deign to put in
>   <stdlib.h>, but let's hope it's at least this.  */
>extern char *getenv ();
>#endif /* not HAVE_STDLIB_H */

and evince includes <stdlib.h> followed by <kpathsea/c-std.h>.

The code in c-std.h assumes that the build system of every dependent 
package will check for stdlib.h and define HAVE_STDLIB_H if found, but 
there is a tendency to stop doing that, and instead assume that all 
platforms comply with a 1989 C standard by now. In particular Evince 
does not check for <stdlib.h>, and includes it unconditionally (I 
assume).

In C11 or older, `extern char *getenv ()` declares getenv() as a 
function taking unspecified parameters and returning a string, but in 
C23 it declares getenv() as a function taking *no* parameters and 
returning a string, hence the compiler sees this as a declaration that 
is incompatible with the one it already saw in <stdlib.h>, and errors 
out:

>/usr/include/kpathsea/c-std.h:48:14: error: conflicting types for ‘getenv’; have ‘char *(void)’
>   48 | extern char *getenv ();
>      |              ^~~~~~

An equivalent failure mode is seen in the evince build log for other 
Standard C functions like strtok() and strstr(). There might be others, 
I didn't inspect all of the kpathsea headers.

evince could presumably work around this by conditionally or 
unconditionally defining HAVE_STDLIB_H, etc., before it includes 
kpathsea headers; but it shouldn't have to, because each library should 
be self-contained.

I think <kpathsea/c-std.h> should do something more like this 
(pseudo-patch, untested) so that it treats __STDC__ as implying that 
every Standard C header is present:

-#ifdef HAVE_STDLIB_H
+#if defined(__STDC__) || defined(HAVE_STDLIB_H)
 #include <stdlib.h>
...

(or it could check __STDC_VERSION__ if preferred)

... or it could just assume that every platform has Standard C headers 
by now, since C89 is several decades old.

Thanks,
    smcv

--- End Message ---
--- Begin Message ---
Source: texlive-bin
Source-Version: 2025.20250727.75242+ds-1
Done: Hilmar Preuße <hille42@debian.org>

We believe that the bug you reported is fixed in the latest version of
texlive-bin, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1109256@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Hilmar Preuße <hille42@debian.org> (supplier of updated texlive-bin package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sun, 27 Jul 2025 23:14:41 +0200
Source: texlive-bin
Architecture: source
Version: 2025.20250727.75242+ds-1
Distribution: experimental
Urgency: medium
Maintainer: Debian TeX Task Force <debian-tex-maint@lists.debian.org>
Changed-By: Hilmar Preuße <hille42@debian.org>
Closes: 991944 1109256
Changes:
 texlive-bin (2025.20250727.75242+ds-1) experimental; urgency=medium
 .
   * New version TL 2025.
     - Contains fix for manual pages (Closes: #991944).
   * Lower C standard to C17. This is assumed to be a workaround for
     #1097988.
   * Remove (incompatible) getenv, strtok & strstr declaration from
     kpathsea headers. (Closes: #1109256).
     https://tug.org/pipermail/tex-live/2025-July/051609.html
Checksums-Sha1:
 eca849b82d28056343759f4907ceae1fc34d4bff 3553 texlive-bin_2025.20250727.75242+ds-1.dsc
 654a56e99ecf20b1d5ecae7a539729b893e4c5e4 35658120 texlive-bin_2025.20250727.75242+ds.orig.tar.xz
 06c4e3c9a0d313264f747a3c92909b009bbb8233 78128 texlive-bin_2025.20250727.75242+ds-1.debian.tar.xz
 bffba1b1ab223f9d399e14d028f1bf7a0995e73a 6168 texlive-bin_2025.20250727.75242+ds-1_source.buildinfo
Checksums-Sha256:
 041c418d5d149a6651c2da857f047bbbb9e3b59bb3245f2e965a8dbfba6bcfc4 3553 texlive-bin_2025.20250727.75242+ds-1.dsc
 32bc34534567dccb39134d2e7802e378bb7303e1567b28706232e5e40eadb762 35658120 texlive-bin_2025.20250727.75242+ds.orig.tar.xz
 020e05d6c1ff48f6b6c4c670c88193f09dbb263237e1a65b6fc3f3ec3f926d32 78128 texlive-bin_2025.20250727.75242+ds-1.debian.tar.xz
 236158671a1bac6211f9532dbf5d894bee47d2962656fe3560d14894f7797687 6168 texlive-bin_2025.20250727.75242+ds-1_source.buildinfo
Files:
 74f31ce6f1a10b76a4a978f9fd3de0b2 3553 tex optional texlive-bin_2025.20250727.75242+ds-1.dsc
 cffd7f5e7b446997ca7a3a795cb56486 35658120 tex optional texlive-bin_2025.20250727.75242+ds.orig.tar.xz
 8817ddfddb50572d0b721e2a704418cf 78128 tex optional texlive-bin_2025.20250727.75242+ds-1.debian.tar.xz
 051896e5cfcd7376dbcd511623874763 6168 tex optional texlive-bin_2025.20250727.75242+ds-1_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEaXGmC/nkbIhxf16kxiZYRqvgLIsFAmiGmnJfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDY5
NzFBNjBCRjlFNDZDODg3MTdGNUVBNEM2MjY1ODQ2QUJFMDJDOEIACgkQxiZYRqvg
LIs7MA/9FVLBae/Va0iIrDCvxhwAkkfzGWc9HAlKUiNa1NkkH59nyy5aOM66ECNr
AlSmwb52svm+sJNc8NzpFmR1oSK7wG42ZFACY6a7FI1XimjhymzfvCDypCPaFqpX
Daic5wPrghUzaGbh10U2KapltPCdvX6fnwrX/4pLgYBkR8S0fgpsxy5/lUSG5qTD
Y65RG7oqcrT7yiBwcLXKpbYvtJCacMhkh5TqA4QC6KlswEQ+i7ZBZLuSa/R98hvy
ZUOs2OKJYptg7RugGfnorHNq/tdByjApbxw2y5deWV2c9uS8S2nSDae3Nf1xZ38N
IuCvoHBMHZrH0DHaJwpHbVnj4DLBLiiBJJdLyBUtLiGUNM6Wcc4lEwbYs+JvUB8F
jtEZC+5kfHWSIkuJe0ZjuDzwMUyZ42irNV5hPzzPjZGUroxQUWU35XU568MQy2UI
tk1K/mQxMvCCj4XStPKl3aKFx8mAWYQrnP2zwu0aTNjvAS8A9pEXkN/vS8uJSaLv
CQz7joNI1QTpUM233qOHopufh8w8adAYkobgxJPRt4uEsr2VT6HQb3xGVe14Y2En
FrOm27vyCXRTzoGo87U6JY2hA9kgC4t5QEx4fGPWlY1QUwshI9UBGsX7e36dXMkM
4OeYHE4Qtvz0xRZmb1enpVlTE/90byN++yGQ2k2UiSRBcMOyNaA=
=IcT8
-----END PGP SIGNATURE-----

Attachment: pgpRi5FzX7WM6.pgp
Description: PGP signature


--- End Message ---

Reply to: