Various build fixes for gcc <= 9.x#60
Open
bkuhls wants to merge 3 commits into
Open
Conversation
lat_sig.c: In function ‘handler’:
lat_sig.c:23:1: error: parameter name omitted
void handler(int) { }
lat_sig.c: In function ‘prot’:
lat_sig.c:72:1: error: parameter name omitted
prot(int) {
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
lat_usleep.c: In function ‘interval’: lat_usleep.c:102:1: error: parameter name omitted interval(int) Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
memsize.c: In function ‘gotalarm’: memsize.c:154:1: error: parameter name omitted gotalarm(int) Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
There was a problem hiding this comment.
Pull request overview
This PR targets GCC ≤ 9 build cleanliness by silencing -Wunused-parameter warnings in several signal handler functions.
Changes:
- Annotate signal handler parameters with
__attribute__((unused))inmemsize,lat_usleep, andlat_sig. - Rename unused handler parameters to
unusedto match the new annotation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/memsize.c |
Marks SIGALRM handler parameter as unused via GCC attribute. |
src/lat_usleep.c |
Marks ITIMER signal handler parameter as unused via GCC attribute. |
src/lat_sig.c |
Marks SIGUSR1/SEGV/BUS handler parameters as unused via GCC attribute. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
153
to
157
| void | ||
| gotalarm(int) | ||
| gotalarm(__attribute__((unused)) int unused) | ||
| { | ||
| alarm_triggered = 1; | ||
| } |
Comment on lines
101
to
105
| void | ||
| interval(int) | ||
| interval(__attribute__((unused)) int unused) | ||
| { | ||
| if (++caught == n) { | ||
| caught = 0; |
| uint64 caught, n; | ||
| double adj; | ||
| void handler(int) { } | ||
| void handler(__attribute__((unused)) int unused) { } |
Comment on lines
71
to
75
| void | ||
| prot(int) { | ||
| prot(__attribute__((unused)) int unused) { | ||
| if (++caught == n) { | ||
| caught = 0; | ||
| n = benchmp_interval(benchmp_getstate()); |
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.
No description provided.