Repository navigation
Backport upstream Valgrind fixes so its tests build with GCC 15 - #102
Conversation
Since C23 bool is a keyword. Also bool wasn't actually used.
tc17_sembar.c:45:14: error: both 'long' and '_Bool' in declaration specifiers
45 | typedef long bool;
| ^~~~
tc17_sembar.c:45:1: warning: useless type name in empty declaration
45 | typedef long bool;
| ^~~~~~~
…local
Since C23 thread_local is a keyword (thread storage duration).
swapcontext.c:23:16: error: expected '{' before 'thread_local'
23 | typedef struct thread_local {
| ^~~~~~~~~~~~
swapcontext.c:23:16: warning: 'thread_local' is not at beginning of declaration [-Wold-style-declaration]
swapcontext.c:23:16: error: 'thread_local' used with 'typedef'
swapcontext.c:26:3: warning: data definition has no type or storage class
26 | } thread_local_t;
| ^~~~~~~~~~~~~~
GCC15 will turn this warning into an error:
bug234814.c: In function 'main':
bug234814.c:20:18: error: assignment to '__sighandler_t' {aka 'void (*)(int)'} from incompatible pointer type 'void (*)(void)' [-Wincompatible-pointer-types]
20 | sa.sa_handler = mysigbus;
| ^
|
Tested: branch |
|
@coderabbitai review |
|
- Valgrind plan: build before the baselines, because check-regtest.sh needs a built tree; save the build log with pipefail. - Readelf plan: drop "make clean", which fails in a fresh clone before valgrind/Makefile exists; use pipefail so that a failed build stops. - 3-way merge: require that "git status --porcelain --ignored valgrind" prints nothing, because "git add -A -f" adds ignored files. - Valgrind plan: note that steps 3-6 and 10 still describe patch and make git-update until codespecs#99 and codespecs#103 land. - plan-pre-upgrade.md: codespecs#102 depends on nothing (land it before codespecs#96); item 6 is done. - Readelf plan: record ldd and nm -u output in the baseline, for the later comparison. - Use "land", not "merge", for pull requests. - Readelf plan: combine the two harvest_* bullets. - Valgrind plan: say to install gdb and glibc debuginfo before the regtest baseline commands, not after them. - Rewrap long lines.
…tracked files; run the Kvasir baseline once; note that codespecs#105 contains codespecs#96 and codespecs#96 contains codespecs#102; describe check-regtest.sh's post-test-check log and --report-only
|
@coderabbitai review |
|
|
@coderabbitai review |
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
GCC 15 compiles C as C23 by default, where
boolandthread_localare keywords andvoid (*)()means "takes no arguments". Three of Valgrind's test programs don't compile under C23, somake regteststops before running any test. Ubuntu 26.04 uses GCC 15; #96's newregtest_ubuntu_26_04CI job failed this way:This backports the three upstream Valgrind commits that fixed them (all in Valgrind 3.25.0), keeping upstream's authorship:
932bf2c02helgrind/tests/tc17_sembar.c: Remove bool typedef907b98572drd/tests/swapcontext.c: Rename typedef struct thread_local to threadlocal8f6cef269none/tests/bug234814.c: sa_handler take an int as argumentEach is a one-line change to a test program. The next Valgrind merge (3.27.1) includes them, so they will merge cleanly then.
This PR is based on
masterand doesn't depend on any other open PR. #96's regtest jobs need it on Ubuntu 26.04.Testing
GCC 15 isn't available on my machine, so I tested with CI: a branch in my fork that merges this PR into #96 ran both regtest jobs. They built all the test programs and ran 787 tests on Ubuntu 26.04 (GCC 15) and 790 on Rocky Linux 10. No further GCC 15 build errors appeared.