0001-Fix-implicit-declaration-of-function-malloc.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From 5185f640045df2b4f8ee7f028fc59e6f02fdf367 Mon Sep 17 00:00:00 2001
  2. From: Brahmajit Das <brahmajit.xyz@gmail.com>
  3. Date: Mon, 29 Jan 2024 23:28:53 +0530
  4. Subject: [PATCH] Fix implicit declaration of function 'malloc'
  5. First observed on Gentoo Linux with GCC 14. This is due to GCC 14
  6. enabling -Werror=implicit-function-declaration by default.
  7. Thus resulting in errors such as:
  8. openconnect-internal.h: In function 'alloc_pkt':
  9. openconnect-internal.h:911:27: error: implicit declaration of function 'malloc' [-Werror=implicit-function-declaration]
  10. 911 | struct pkt *pkt = malloc(alloc_len);
  11. | ^~~~~~
  12. Plese refer gentoo bug: https://bugs.gentoo.org/923173
  13. Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
  14. Upstream: https://gitlab.com/openconnect/openconnect/-/commit/5185f640045df2b4f8ee7f028fc59e6f02fdf367
  15. Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
  16. [rebased for 9.12]
  17. ---
  18. openconnect-internal.h | 1 +
  19. 1 file changed, 1 insertion(+)
  20. diff --git a/openconnect-internal.h b/openconnect-internal.h
  21. index 21460adf6..2830d693f 100644
  22. --- a/openconnect-internal.h
  23. +++ b/openconnect-internal.h
  24. @@ -87,6 +87,7 @@
  25. #include <libxml/tree.h>
  26. #include <zlib.h>
  27. +#include <stdlib.h>
  28. #ifdef _WIN32
  29. #ifndef _Out_cap_c_
  30. --
  31. GitLab