Skip to contentSkip to conversation

package/shadowsocks-libev: fix missing const

PATCH In review James Hilliard 2 participants 2 messages May 19 – May 20

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/shadowsocks-libev: fix missing const

Fixes:
output/build/shadowsocks-libev-v3.3.6/src/netutils.c:278:28: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
278 | char *next_dot = strchr(label, '.');

---
 .../0001-Fix-build-with-gcc13.patch           | 41 +++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 package/shadowsocks-libev/0001-Fix-build-with-gcc13.patch
package/shadowsocks-libev/0001-Fix-build-with-gcc13.patch new file +41 -0
new file mode 100644
index 0000000000..6bae81434a
@@ -0,0 +1,41 @@
+From 59a6aca7597c46cd1d079631d3061d952fbd0d6e Mon Sep 17 00:00:00 2001
+From: Hillwood Yang <[email protected]>
+Date: Tue, 5 May 2026 14:39:10 +0800
+Subject: [PATCH] Fix build with gcc13
+
+Signed-off-by: James Hilliard <[email protected]>
+Upstream: https://github.com/shadowsocks/shadowsocks-libev/pull/3038
+---
+ src/acl.c      | 2 +-
+ src/netutils.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/acl.c b/src/acl.c
+index 1efc1aa..c77bbd7 100644
+--- a/src/acl.c
++++ b/src/acl.c
+@@ -57,7 +57,7 @@ static void
+ parse_addr_cidr(const char *str, char *host, int *cidr)
+ {
+     int ret = -1;
+-    char *pch;
++    const char *pch;
+ 
+     pch = strchr(str, '/');
+     while (pch != NULL) {
+diff --git a/src/netutils.c b/src/netutils.c
+index 8c7329a..35b2dc1 100644
+--- a/src/netutils.c
++++ b/src/netutils.c
+@@ -275,7 +275,7 @@ validate_hostname(const char *hostname, const int hostname_len)
+     const char *label = hostname;
+     while (label < hostname + hostname_len) {
+         size_t label_len = hostname_len - (label - hostname);
+-        char *next_dot   = strchr(label, '.');
++        const char *next_dot = strchr(label, '.');
+         if (next_dot != NULL)
+             label_len = next_dot - label;
+ 
+-- 
+2.53.0
+
Signature · 6 lines
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 1 line · James Hilliard

Fixes:

Please use

Fixes <link to autobuilder failure>

I've added that and applied to master, thanks.

Regards,
Arnout

Quoted 46 lines

output/build/shadowsocks-libev-v3.3.6/src/netutils.c:278:28: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
278 | char *next_dot = strchr(label, '.');

---
  .../0001-Fix-build-with-gcc13.patch           | 41 +++++++++++++++++++
  1 file changed, 41 insertions(+)

create mode 100644 package/shadowsocks-libev/0001-Fix-build-with-gcc13.patch

package/shadowsocks-libev/0001-Fix-build-with-gcc13.patch new file +31 -0
new file mode 100644
index 0000000000..6bae81434a
@@ -0,0 +1,41 @@
+From 59a6aca7597c46cd1d079631d3061d952fbd0d6e Mon Sep 17 00:00:00 2001
+From: Hillwood Yang <[email protected]>
+Date: Tue, 5 May 2026 14:39:10 +0800
+Subject: [PATCH] Fix build with gcc13
+
+Signed-off-by: James Hilliard <[email protected]>
+Upstream: https://github.com/shadowsocks/shadowsocks-libev/pull/3038
+---
+ src/acl.c      | 2 +-
+ src/netutils.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/acl.c b/src/acl.c
+index 1efc1aa..c77bbd7 100644
+--- a/src/acl.c
++++ b/src/acl.c
+@@ -57,7 +57,7 @@ static void
+ parse_addr_cidr(const char *str, char *host, int *cidr)
+ {
+     int ret = -1;
+-    char *pch;
++    const char *pch;
+
+     pch = strchr(str, '/');
+     while (pch != NULL) {
+diff --git a/src/netutils.c b/src/netutils.c
+index 8c7329a..35b2dc1 100644
+--- a/src/netutils.c
++++ b/src/netutils.c
+@@ -275,7 +275,7 @@ validate_hostname(const char *hostname, const int hostname_len)
+     const char *label = hostname;

package/shadowsocks-libev/0001-Fix-build-with-gcc13.patch line 41

Quoted 10 lines
package/shadowsocks-libev/0001-Fix-build-with-gcc13.patch new file +10 -0
+     while (label < hostname + hostname_len) {
+         size_t label_len = hostname_len - (label - hostname);
+-        char *next_dot   = strchr(label, '.');
++        const char *next_dot = strchr(label, '.');
+         if (next_dot != NULL)
+             label_len = next_dot - label;
+
+--
+2.53.0
+

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot