common/wireaddr: fix GCC 15 const-qualifier errors
What changed, and why it matters
This is a minor build-compatibility fix for the GCC 15 compiler. It changes two local variables from `char *` to `const char *` so the code compiles cleanly with newer, stricter compiler warnings. There is no functional change and no security impact.
No security action needed. Treat as a normal build-fix commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit updates common/wireaddr.c in the separate_address_and_port function. GCC 15 now returns const char * from strchr/strrchr when given a const char * input, so assigning the result to a char * triggers -Werror=discarded-qualifiers. The patch declares portcolon and end as const char * to match. Both variables are only read, so behavior is unchanged.
Changed components
common/wireaddr.cInspect captured patch +2 / −2
diff --git a/common/wireaddr.c b/common/wireaddr.c
index b110ed54..c4e840ea 100644
--- a/common/wireaddr.c
+++ b/common/wireaddr.c
@@ -291,10 +291,10 @@ char *fmt_wireaddr(const tal_t *ctx, const struct wireaddr *a)
bool separate_address_and_port(const tal_t *ctx, const char *arg,
char **addr, u16 *port)
{
- char *portcolon;
+ const char *portcolon;
if (strstarts(arg, "[")) {
- char *end = strchr(arg, ']');
+ const char *end = strchr(arg, ']');
if (!end)
return false;
/* Copy inside [] */
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.