aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2026-02-15 14:41:20 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2026-02-15 15:15:30 +0100
commitb668e52c906b664b353d5a99cfa3ff36f73b341d (patch)
tree85ab744c5dd15c21633b89a518ff001225c98494 /coreutils
parent9e8f8a196838b63acdbd2c9b48a2a333bc885e8b (diff)
downloadbusybox-w32-b668e52c906b664b353d5a99cfa3ff36f73b341d.tar.gz
busybox-w32-b668e52c906b664b353d5a99cfa3ff36f73b341d.tar.bz2
busybox-w32-b668e52c906b664b353d5a99cfa3ff36f73b341d.zip
*: placate warnings where strchr/strstr returns constant pointer
Newer glibc is now smarter and can propagate const-ness from those! function old new delta readtoken1 3111 3108 -3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/od_bloaty.c7
-rw-r--r--coreutils/printf.c2
2 files changed, 5 insertions, 4 deletions
diff --git a/coreutils/od_bloaty.c b/coreutils/od_bloaty.c
index e886a4ed2..c0e6681f2 100644
--- a/coreutils/od_bloaty.c
+++ b/coreutils/od_bloaty.c
@@ -1155,7 +1155,7 @@ dump_strings(off_t address, off_t end_offset)
1155 leading '+' return nonzero and set *OFFSET to the offset it denotes. */ 1155 leading '+' return nonzero and set *OFFSET to the offset it denotes. */
1156 1156
1157static int 1157static int
1158parse_old_offset(const char *s, off_t *offset) 1158parse_old_offset(char *s, off_t *offset)
1159{ 1159{
1160 static const struct suffix_mult Bb[] ALIGN_SUFFIX = { 1160 static const struct suffix_mult Bb[] ALIGN_SUFFIX = {
1161 { "B", 1024 }, 1161 { "B", 1024 },
@@ -1181,7 +1181,8 @@ parse_old_offset(const char *s, off_t *offset)
1181 radix = 16; 1181 radix = 16;
1182 1182
1183 *offset = xstrtooff_sfx(s, radix, Bb); 1183 *offset = xstrtooff_sfx(s, radix, Bb);
1184 if (p) p[0] = '.'; 1184 if (p)
1185 p[0] = '.'; /* undo cheating */
1185 1186
1186 return (*offset >= 0); 1187 return (*offset >= 0);
1187} 1188}
@@ -1234,7 +1235,7 @@ int od_main(int argc UNUSED_PARAM, char **argv)
1234 static const uint8_t doxn_address_pad_len_char[] ALIGN1 = { 1235 static const uint8_t doxn_address_pad_len_char[] ALIGN1 = {
1235 '7', '7', '6', /* '?' */ 1236 '7', '7', '6', /* '?' */
1236 }; 1237 };
1237 char *p; 1238 const char *p;
1238 int pos; 1239 int pos;
1239 p = strchr(doxn, str_A[0]); 1240 p = strchr(doxn, str_A[0]);
1240 if (!p) 1241 if (!p)
diff --git a/coreutils/printf.c b/coreutils/printf.c
index 4edcfa9b5..3cd48cfcc 100644
--- a/coreutils/printf.c
+++ b/coreutils/printf.c
@@ -354,7 +354,7 @@ static char **print_formatted(char *f, char **argv, int *conv_err)
354 /* Add "ll" if integer modifier, then print */ 354 /* Add "ll" if integer modifier, then print */
355 { 355 {
356 static const char format_chars[] ALIGN1 = "diouxXfeEgGcs"; 356 static const char format_chars[] ALIGN1 = "diouxXfeEgGcs";
357 char *p = strchr(format_chars, *f); 357 char *p = (char*)strchr(format_chars, *f);
358 /* needed - try "printf %" without it */ 358 /* needed - try "printf %" without it */
359 if (p == NULL || *f == '\0') { 359 if (p == NULL || *f == '\0') {
360 bb_error_msg("%s: invalid format", direc_start); 360 bb_error_msg("%s: invalid format", direc_start);