summaryrefslogtreecommitdiff
path: root/net-analyzer/suricata/files/suricata-7.0.3_fix-build-with-gcc14.patch
blob: 7ebacf76852c6b54c4f511ee7187bee698685d97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Bug: From b5280929c58559c178415ce199157b5c87171258 Mon Sep 17 00:00:00 2001
From: Brahmajit Das <brahmajit.xyz@gmail.com>
Date: Tue, 20 Feb 2024 12:05:57 +0530
Subject: [PATCH 1/1] Fix passing incompatible pointer type with GCC 14
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

GCC 14 (and newer compilers like Clang 16) enables
-Wincompatible-pointer-types by default, along with some other flags.
Thus resulting in build errors such as

util-host-info.c: In function ‘SCKernelVersionIsAtLeast’:
util-host-info.c:94:31: error: passing argument 1 of ‘pcre2_substring_list_free_8’ from incompatible pointer type [-Wincompatible-pointer-types]
   94 |     pcre2_substring_list_free((PCRE2_SPTR *)list);
      |                               ^~~~~~~~~~~~~~~~~~
      |                               |
      |                               const PCRE2_UCHAR8 ** {aka const unsigned char **}

Removing the casting make suricata build with GCC 14.

First discovered on Gentoo Linux with GCC 14

Bug: https://bugs.gentoo.org/925011
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
--- a/src/util-host-info.c
+++ b/src/util-host-info.c
@@ -91,7 +91,7 @@ int SCKernelVersionIsAtLeast(int major, int minor)
         err = true;
     }
 
-    pcre2_substring_list_free((PCRE2_SPTR *)list);
+    pcre2_substring_list_free(list);
     pcre2_match_data_free(version_regex_match);
     pcre2_code_free(version_regex);
 
-- 
2.43.2