]> git.ipfire.org Git - thirdparty/unbound.git/commit
fix build with gcc-15 -Wbuiltin-declaration-mismatch error 1262/head
authormark.yang <mark.yang@lge.com>
Wed, 2 Apr 2025 06:25:42 +0000 (15:25 +0900)
committermark.yang <mark.yang@lge.com>
Wed, 2 Apr 2025 06:25:42 +0000 (15:25 +0900)
commit1c58ce07919c36e6a11eead67bd6d14cc22acaec
tree96dda4c9eb796fed6ed68abb68d9ca1ceb0152ee
parent7985d17b57d25be262de56c29a43ae4b61c1b896
fix build with gcc-15 -Wbuiltin-declaration-mismatch error

See more details: http://errors.yoctoproject.org/Errors/Details/850313
../git/compat/malloc.c:9:7: warning: conflicting types for built-in function 'malloc'; expected 'void *(long unsigned int)' [-Wbuiltin-declaration-mismatch]
    9 | void *malloc ();
      |       ^~~~~~
../git/compat/malloc.c:5:1: note: 'malloc' is declared in header '<stdlib.h>'
    4 | #include "config.h"
  +++ |+#include <stdlib.h>
    5 | #undef malloc
../git/compat/malloc.c: In function 'rpl_malloc_unbound':
../git/compat/malloc.c:23:10: error: too many arguments to function 'malloc'; expected 0, have 1
   23 |   return malloc (n);
      |          ^~~~~~  ~
../git/compat/malloc.c:9:7: note: declared here
    9 | void *malloc ();
      |       ^~~~~~

* Seeing that there is '#undef malloc', it appears they don't want to
  use the malloc from stdlib.h.
  Therefore, we need to correctly define the parameters for malloc.

Signed-off-by: mark.yang <mark.yang@lge.com>
compat/malloc.c