Skip to content

Conversation

@rountree
Copy link

@rountree rountree commented Nov 21, 2025

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.

commit 47cb39:  Fixes three errors caused by stricter gcc defaults.
commit c6f85d:  Fixes one [-Wdiscarded-qualifiers] and one [-Wstringop-truncation].
commit a7260c:  Fixes fallthrough and initialization warnings.
commit acc263:  Fixes -Wsign-compare warnings.
commit 5182e8:  Fixes -Wformat warnings.
commit 32d0c6:  Suppresses -Wunused-parameter warnings by casting to void.

Fixes #94

nchaimov and others added 11 commits November 18, 2025 15:39
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.
@mplegendre
Copy link
Member

This looks like it needs a rebase. Existing commits from both Nick and I are in here with changed hashes.
How does this relate to your other warning cleanup?

@rountree
Copy link
Author

rountree commented Dec 1, 2025

I closed out the other warning cleanup PR; this PR replaces it. I'll get a rebase committed later this morning.

@rountree
Copy link
Author

rountree commented Dec 1, 2025

Just a single file needed cleanup. Compiles without errors or warning with -Wall -Wextra -Werror using gcc-15.1.0 on Tuolumne. All runTests passed.

@rountree rountree marked this pull request as ready for review December 1, 2025 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clean up warnings

4 participants