PS-10970 fix clang volatile warnings#15
Open
lukin-oleksiy wants to merge 1 commit into
Open
Conversation
https://perconadev.atlassian.net/browse/PS-10970 Fix Clang volatile deprecation warnings in `src/linuxthreads.cc`, and silence the related empty-struct C/C++ compatibility warning in `src/elfcore.cc`. Also enable the appropriate compiler-specific C++ warning in `src/CMakeLists.txt` (`-Wdeprecated-volatile` for Clang/AppleClang, `-Wvolatile` for GCC). A broader `-Wall` cleanup is intentionally out of scope for this PR, since it introduces a larger set of unrelated legacy warnings and would make this change much less focused and riskier to review.
| #define regs i386_regs /* General purpose registers */ | ||
| #elif defined(__ARM_ARCH_3__) | ||
| typedef struct fpxregs { /* No extended FPU registers on ARM */ | ||
| uint8_t unused; |
There was a problem hiding this comment.
I didn't analyze the whole thing, but see that there are places like memcpy(fpx, scratch, sizeof(struct fpxregs)); in code...
inikep
reviewed
May 12, 2026
| target_compile_options( | ||
| coredumper PRIVATE | ||
| $<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>:-Wdeprecated-volatile> | ||
| $<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wvolatile> |
Contributor
There was a problem hiding this comment.
This may require a quite new cmake version. Please check it.
| /* to do so in sys_ptrace_detach(). */ | ||
| sys_sched_yield(); | ||
| sys_ptrace(PTRACE_KILL, sig_pids[sig_num_threads], 0, 0); | ||
| sys_ptrace(PTRACE_KILL, sig_pids[next_thread], 0, 0); |
Contributor
There was a problem hiding this comment.
The issue here seems to be sig_num_threads-- for sig_num_threads=0.
Isn't it much easier to use:
while (sig_num_threads > 0) {
sys_sched_yield();
sys_ptrace(PTRACE_KILL, sig_pids[sig_num_threads], 0, 0);
sig_num_threads--;
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://perconadev.atlassian.net/browse/PS-10970
Fix Clang volatile deprecation warnings in
src/linuxthreads.cc, and silence the related empty-struct C/C++ compatibility warning insrc/elfcore.cc.Also enable the appropriate compiler-specific C++ warning in
src/CMakeLists.txt(-Wdeprecated-volatilefor Clang/AppleClang,-Wvolatilefor GCC).A broader
-Wallcleanup is intentionally out of scope for this PR, since it introduces a larger set of unrelated legacy warnings and would make this change much less focused and riskier to review.