Skip to content

Commit 16dded8

Browse files
author
Christophe Jaillet
committed
strchr() takes a char * as a first parameter, and in the cases a const char * is passed.
This breaks build process at least with gcc 16.1.1 and maintainer-mode enabled. Without maintainer-mode, only a warning is generated. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1934597 13f79535-47bb-0310-9956-ffa450edef68
1 parent 5d4d5b4 commit 16dded8

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎support/ab.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2873,7 +2873,7 @@ static int parse_url(const char *url)
28732873
}
28742874
#endif
28752875

2876-
if ((cp = strchr(url, '/')) == NULL)
2876+
if ((cp = strchr((char *)url, '/')) == NULL)
28772877
return 1;
28782878
h = apr_pstrmemdup(cntxt, url, cp - url);
28792879
rv = apr_parse_addr_port(&hostname, &scope_id, &port, h, cntxt);
@@ -3203,7 +3203,7 @@ int main(int argc, const char * const argv[])
32033203
/*
32043204
* assume proxy-name[:port]
32053205
*/
3206-
if ((p = strchr(opt_arg, ':'))) {
3206+
if ((p = strchr((char *)opt_arg, ':'))) {
32073207
*p = '\0';
32083208
p++;
32093209
proxyport = atoi(p);

‎support/rotatelogs.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -540,16 +540,16 @@ static const char *get_time_or_size(rotate_config_t *config,
540540
char *ptr = NULL;
541541
/* Byte multiplier */
542542
unsigned int mult = 1;
543-
if ((ptr = strchr(arg, 'B')) != NULL) { /* Found KB size */
543+
if ((ptr = strchr((char *)arg, 'B')) != NULL) { /* Found KB size */
544544
mult = 1;
545545
}
546-
else if ((ptr = strchr(arg, 'K')) != NULL) { /* Found KB size */
546+
else if ((ptr = strchr((char *)arg, 'K')) != NULL) { /* Found KB size */
547547
mult = 1024;
548548
}
549-
else if ((ptr = strchr(arg, 'M')) != NULL) { /* Found MB size */
549+
else if ((ptr = strchr((char *)arg, 'M')) != NULL) { /* Found MB size */
550550
mult = 1024 * 1024;
551551
}
552-
else if ((ptr = strchr(arg, 'G')) != NULL) { /* Found GB size */
552+
else if ((ptr = strchr((char *)arg, 'G')) != NULL) { /* Found GB size */
553553
mult = 1024 * 1024 * 1024;
554554
}
555555
if (ptr) { /* rotation based on file size */

0 commit comments

Comments
 (0)