OpenAFS Master Repository branch, master, updated. openafs-devel-1_9_2-442-ga2887db
Gerrit Code Review
gerrit@openafs.org
Tue, 24 Mar 2026 16:15:45 -0400
The following commit has been merged in the master branch:
commit a2887dbec96a3da5af5ff932032b936930b305f7
Author: Michael Meffie <mmeffie@sinenomine.net>
Date: Mon Mar 23 19:50:56 2026 -0400
Fix -Wdiscarded-qualifiers warnings from strrchr()
In recent versions of GCC (e.g. GCC 14) and of glibc (e.g., 2.43), the
strrchr() function has been updated to follow ISO C23 rules, which can
trigger the discarded-qualifiers warning when the strrchr() input is a
`const char *` but the function return is assigned to a type `char *`.
Assigning this result to a `char *` discards the const qualifier, which
causes the following build failure when building with the
--enable-checking configure option (which adds -Werror to the CFLAGS):
compile_et.c:170:7: error: assignment discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
170 | p = strrchr(whoami, '/');
| ^
cc1: all warnings being treated as errors
Change the strrchr() destination pointer from `char *` to `const char *`
in the locations where the input string is a const char *.
Add a new local variable in compile_et.c for the destination pointer,
since the `char *` variable is reused in the affected function.
Change-Id: I4eb7a63b5e5885843b882dd79d8a9314d690ae44
Reviewed-on: https://gerrit.openafs.org/16750
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
src/bozo/bos.c | 2 +-
src/comerr/compile_et.c | 8 +++++---
src/tests/warnerr.c | 4 ++--
3 files changed, 8 insertions(+), 6 deletions(-)
--
OpenAFS Master Repository