]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
strchr() takes a char * as a first parameter, and in the cases a const char * is...
authorChristophe Jaillet <jailletc36@apache.org>
Mon, 25 May 2026 15:56:03 +0000 (15:56 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Mon, 25 May 2026 15:56:03 +0000 (15:56 +0000)
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

support/ab.c
support/rotatelogs.c

index e3101a632e662d12f1fa22f0d0ab6256cfcbb13c..2a611eeb69d2a791f50f07a6df3045c2c47c8ab5 100644 (file)
@@ -2873,7 +2873,7 @@ static int parse_url(const char *url)
     }
 #endif
 
-    if ((cp = strchr(url, '/')) == NULL)
+    if ((cp = strchr((char *)url, '/')) == NULL)
         return 1;
     h = apr_pstrmemdup(cntxt, url, cp - url);
     rv = apr_parse_addr_port(&hostname, &scope_id, &port, h, cntxt);
@@ -3203,7 +3203,7 @@ int main(int argc, const char * const argv[])
                     /*
                      * assume proxy-name[:port]
                      */
-                    if ((p = strchr(opt_arg, ':'))) {
+                    if ((p = strchr((char *)opt_arg, ':'))) {
                         *p = '\0';
                         p++;
                         proxyport = atoi(p);
index 146715b3ac496b452c5eb4655d0eecb5a2094983..075f68333102f3ad2ede07ff89934b18148533c3 100644 (file)
@@ -540,16 +540,16 @@ static const char *get_time_or_size(rotate_config_t *config,
     char *ptr = NULL;
     /* Byte multiplier */
     unsigned int mult = 1;
-    if ((ptr = strchr(arg, 'B')) != NULL) { /* Found KB size */
+    if ((ptr = strchr((char *)arg, 'B')) != NULL) { /* Found KB size */
         mult = 1;
     }
-    else if ((ptr = strchr(arg, 'K')) != NULL) { /* Found KB size */
+    else if ((ptr = strchr((char *)arg, 'K')) != NULL) { /* Found KB size */
         mult = 1024;
     }
-    else if ((ptr = strchr(arg, 'M')) != NULL) { /* Found MB size */
+    else if ((ptr = strchr((char *)arg, 'M')) != NULL) { /* Found MB size */
         mult = 1024 * 1024;
     }
-    else if ((ptr = strchr(arg, 'G')) != NULL) { /* Found GB size */
+    else if ((ptr = strchr((char *)arg, 'G')) != NULL) { /* Found GB size */
         mult = 1024 * 1024 * 1024;
     }
     if (ptr) { /* rotation based on file size */