-
Notifications
You must be signed in to change notification settings - Fork 31
Fixes/updates for compilation under gcc 15.1.0 -Wall -Wextra -Werror #120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This looks like it needs a rebase. Existing commits from both Nick and I are in here with changed hashes. |
|
I closed out the other warning cleanup PR; this PR replaces it. I'll get a rebase committed later this morning. |
|
Just a single file needed cleanup. Compiles without errors or warning with |
|
|
||
| typedef struct { | ||
| volatile int cur_id; | ||
| unsigned long locks[2]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm nervous about changing the locks[] layout here. I don't remember why I wrote it this way, but I wouldn't have done something this odd without reason. Given that arrays and structs can have different packing (even if on x86_64 it shouldn't pack struct vs array different here), it might have had something to do with that. There's also some memory barriers around the code that uses these arrays, and there's always tough subtleties when those are involved.
That said, I can't re-determine why these should be arrays with just code inspection. And it's too bad I didn't comment why it's like this.
Given that this is a warning cleanup commit, let's not risk subtle semantic changes.
(And this applies to the two other array->struct conversions below as well)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Getting the #includes to work required updating a couple of Makefile.ams.
src/client/client/realpath.c
Outdated
| The source file is glibc/stdlib/canonicalize.c at git commit 1894e219dc530d7074085e95ffe3c1e66cebc072 | ||
| */ | ||
|
|
||
| #pragma GCC diagnostic ignored "-Wsign-compare" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are macros in src/utils/ccwarns.h for doing these
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those are handy. I've narrowed the range of the disabled warning to a single while loop. Putting the macro around the while test seems safe, but I'm not familiar with the rules of putting #praga within statements or across loop boundaries.
|
Also, it looks like you did a merge to resolve the conflicts. |
…acket for all sec-types.
gcc-15.1.0 throws an error on declaration/definition mismatches. /p/vast1/rountree/repos/Spindle/src/client/biter/../../biter/linux_ids.c:27:14: error: conflicting types for ‘biterc_get_rank’; have ‘unsigned int(int)’ /p/vast1/rountree/repos/Spindle/src/client/biter/../../biter/shmutil.c:242:6: error: conflicting types for ‘update_shm_id’; have ‘void(shminfo_t *)’ /p/vast1/rountree/repos/Spindle/src/client/client/remap_exec.c:168:6: error: conflicting types for ‘remap_executable’; have ‘void(int)’ Updates header files in each case. Passes runTests.
Spindle/src/client/client/exec_util.c:201:21: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] Fixed by strdup-ing string to preserve constness of original. Spindle/src/server/cache/../../utils/pathfn.c:61:4: warning: ‘strncpy’ output may be truncated copying between 0 and 4096 bytes from a string of length 4096 [-Wstringop-truncation] Code is correct but the compiler can't deduce that. Replaced strncpy() with strdup()+snprintf(). https://developers.redhat.com/blog/2018/05/24/detecting-string-truncation-with-gcc-8#forming_truncated_strings_with_strncat
Spindle/src/server/auditserver/ldcs_audit_server_handlers.c:1442:10: warning: this statement may fall through [-Wimplicit-fallthrough=] Solved with magic comment. https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7 Spindle/src/fe/startup/config_mgr.cc:808:13: warning: this statement may fall through [-Wimplicit-fallthrough=] Actual error, fixed by adding missing break. Spindle/testsuite/symbind_test.c:310:7: warning: missing initializer for field ‘matched’ of ‘test_bindings_t’ [-Wmissing-field-initializers] Added missing NULL to intializaiton.
/p/vast1/rountree/repos/Spindle/src/client/biter/../../biter/shmutil.c:45:43: Split out pid_t and locks into their own variables/arrays. Affects lock_t, base_header_t, biter_header_t, and shmcache_header_t. /p/vast1/rountree/repos/Spindle/src/client/biter/../../biter/demultiplex.c:197:17: Changed type of msg_header_t.msg_target from uint32_t to int (src/biter/demultiplex.h) /p/vast1/rountree/repos/Spindle/src/client/auditclient/writablegot.c:121:21: Cribbed from earlier solution. /p/vast1/rountree/repos/Spindle/src/client/client/../../utils/parseloc.c:250:15: Cribbed. /p/vast1/rountree/repos/Spindle/src/client/client/../../utils/fileutil.c:84:25: Cribbed. /p/vast1/rountree/repos/Spindle/src/client/client/remap_exec.c:94:33: Cribbed. /p/vast1/rountree/repos/Spindle/src/client/client/intercept_readlink.c:147:12: Cribbed. /p/vast1/rountree/repos/Spindle/src/client/client_comlib/client_api_socket.c:237:11: Cribbed early solution. /p/vast1/rountree/repos/Spindle/src/client/client_comlib/client_api.c:235:22: Trickier than most, as the code is dependent on the size of the variables in question. /p/vast1/rountree/repos/Spindle/src/client/client/realpath.c:369:17: In the interest of tracking the original glibc code, disable this warning. /p/vast1/rountree/repos/Spindle/src/client/subaudit/update_pltbind.c:185:18: Cribbed. /p/vast1/rountree/repos/Spindle/src/server/biter/../../biter/biterd.c:90:18: Cribbed. /p/vast1/rountree/repos/Spindle/src/server/cache/global_name.c:71:11: int->size_t /p/vast1/rountree/repos/Spindle/src/server/cobo/../../cobo/cobo.c:477:25: Replaced inet_addr() call with intel_aton() per man page recommendation. /p/vast1/rountree/repos/Spindle/src/server/cobo/../../cobo/handshake.c:689:22: warning: Used ssize_t to allow errors and data to share the same channel. /p/vast1/rountree/repos/Spindle/src/server/comlib/ldcs_api_socket.c:291:11: Duplicated code... /p/vast1/rountree/repos/Spindle/src/server/comlib/ldcs_api_pipe.c: In function ‘ldcs_send_msg_pipe’: Familiar issue of read/write returning ints and those sizes being stored in size_ts. /p/vast1/rountree/repos/Spindle/src/server/auditserver/ldcs_elf_read.c: In function ‘readUpTo’: Interesting that fread does not return an error condition, nor does it set errno.o /p/vast1/rountree/repos/Spindle/src/server/auditserver/ldcs_audit_server_requestors.c: In function ‘get_requestor’: Cribbed. /p/vast1/rountree/repos/Spindle/src/server/auditserver/ldcs_audit_server_numa.c: In function ‘pattern_match’: Cribbed. src/server/auditserver/ldcs_audit_server_handlers.c Nothing remarkable. Passes runTests.
Rebased on devel. Passes all runTests on tuolumne. Note that there are configuration tests that are erroring out due to -Werror. Low priority, but probably worth fixing. Need to rerun bootstrap due to Makefile.am changes.
|
I just noticed that |
We're now good to go with -Wall -Wextra -Werror.
Fixes and updates to compile under gcc 15.1.0 with the flags
-Wall,-Wextra, and-Werror.Commits are based on the class of errors/warnings rather than files.
Fixes #94