#1128742 psychtoolbox-3: FTBFS with glibc 2.43 due to ISO C23 const return types

#1128742#5
Date:
2026-02-22 16:16:54 UTC
From:
To:
Dear maintainer(s),

psychtoolbox-3 fails to build from source with glibc 2.43, currently in
experimental. From the build log:

| Common/Screen/PsychVideoCaptureSupportGStreamer.c: In function ‘PsychVideoBusCallback’:
| Common/Screen/PsychVideoCaptureSupportGStreamer.c:512:13: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
|   512 |             if (PsychPrefStateGet_Verbosity() > 4) printf("PTB-DEBUG: Videobus: Message EOS received.\n"); fflush(NULL);
|       |             ^~
| Common/Screen/PsychVideoCaptureSupportGStreamer.c:512:108: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
|   512 |             if (PsychPrefStateGet_Verbosity() > 4) printf("PTB-DEBUG: Videobus: Message EOS received.\n"); fflush(NULL);
|       |                                                                                                            ^~~~~~
| Common/Screen/PsychVideoCaptureSupportGStreamer.c: At top level:
| Common/Screen/PsychVideoCaptureSupportGStreamer.c:687:1: warning: missing initializer for field ‘_gst_reserved’ of ‘GstAppSinkCallbacks’ [-Wmissing-field-initializers]
|   687 | };
|       | ^
| In file included from Common/Screen/PsychVideoCaptureSupportGStreamer.c:78:
| /usr/include/gstreamer-1.0/gst/app/gstappsink.h:86:16: note: ‘_gst_reserved’ declared here
|    86 |   gpointer     _gst_reserved[GST_PADDING - 2];
|       |                ^~~~~~~~~~~~~
| Common/Screen/PsychVideoCaptureSupportGStreamer.c: In function ‘CreateGStreamerElementFromString’:
| Common/Screen/PsychVideoCaptureSupportGStreamer.c:1670:27: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|  1670 |         codecPipelineSpec = strstr(codecSpec, typeSpec);
|       |                           ^
| Common/Screen/PsychVideoCaptureSupportGStreamer.c: In function ‘PsychGSVideoCaptureSetParameter’:
| Common/Screen/PsychVideoCaptureSupportGStreamer.c:5181:44: error: assignment of read-only location ‘*(const char *)strstr(pname, (const char *)":CodecType")’
|  5181 |             *(strstr(pname, ":CodecType")) = 0;
|       |                                            ^
| Common/Screen/PsychVideoCaptureSupportGStreamer.c:5122:11: warning: unused variable ‘oldfvalue’ [-Wunused-variable]
|  5122 |     float oldfvalue = FLT_MAX;
|       |           ^~~~~~~~~
| Common/Screen/PsychVideoCaptureSupportGStreamer.c: In function ‘PsychGSOpenVideoCaptureDevice’:
| Common/Screen/PsychVideoCaptureSupportGStreamer.c:3415:13: warning: ‘strncpy’ output truncated before terminating nul copying 14 bytes from a string of the same length [-Wstringop-truncation]
|  3415 |             strncpy(codecSpec, "DEFAULTenc    ", strlen("DEFAULTenc    "));
|       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| error: mkoctfile: building exited with failure status
| error: ignoring const execution_exception& while preparing to exit
| make[1]: *** [debian/rules:59: build-stamp] Error 1
| make[1]: Leaving directory '/build/reproducible-path/psychtoolbox-3-3.0.19.14.dfsg1'
| make: *** [debian/rules:36: binary] Error 2
| dpkg-buildpackage: error: debian/rules binary subprocess failed with exit status 2

The full build log is available here [1].

The issue is due to ISO C23 declaration of bsearch, memchr, strchr,
strpbrk, strrchr, strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr,
which now returns a pointer to a const-qualified type when the input
argument is a pointer to a const-qualified type [2].

I would like to thanks Emanuele Rocca for doing the archive rebuild on
a fast arm64 server.

Regards
Aurelien

[1] https://people.debian.org/~ema/glibc-2.43-rebuilds/output-1/psychtoolbox-3_arm64.build
[2] https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS;h=e271fb2e4d76903c77a302aaec1ca22ce31027d0;hb=f762ccf84f122d1354f103a151cba8bde797d521#l19