From ba92efcbab032a7b8ca0f06cdb618e6837e337a0 Mon Sep 17 00:00:00 2001 From: Dongkyun Son Date: Fri, 17 May 2024 20:10:00 +0900 Subject: [PATCH] Fix build error : conflicting types for 'malloc'; [ 149s] dfa.c:37:14: warning: conflicting types for built-in function 'calloc'; expected 'void *(unsigned int, unsigned int)' [-Wbuiltin-declaration-mismatch] [ 149s] 37 | extern char *calloc(), *malloc(), *realloc(); [ 149s] | ^~~~~~ [ 149s] dfa.c:31:1: note: 'calloc' is declared in header '' [ 149s] 30 | #include [ 149s] +++ |+#include [ 149s] 31 | #else [ 149s] dfa.c:37:25: warning: conflicting types for built-in function 'malloc'; expected 'void *(unsigned int)' [-Wbuiltin-declaration-mismatch] [ 149s] 37 | extern char *calloc(), *malloc(), *realloc(); [ 149s] | ^~~~~~ [ 149s] dfa.c:37:25: note: 'malloc' is declared in header '' [ 149s] dfa.c:37:36: warning: conflicting types for built-in function 'realloc'; expected 'void *(void *, unsigned int)' [-Wbuiltin-declaration-mismatch] [ 149s] 37 | extern char *calloc(), *malloc(), *realloc(); [ 149s] | ^~~~~~~ [ 149s] dfa.c:37:36: note: 'realloc' is declared in header '' ... [ 149s] In file included from mbsupport.h:36, [ 149s] from dfa.c:102: [ 149s] /usr/include/stdlib.h:672:14: error: conflicting types for 'malloc'; have 'void *(size_t)' {aka 'void *(unsigned int)'} [ 149s] 672 | extern void *malloc (size_t __size) __THROW __attribute_malloc__ [ 149s] | ^~~~~~ [ 149s] dfa.c:37:25: note: previous declaration of 'malloc' with type 'char *()' [ 149s] 37 | extern char *calloc(), *malloc(), *realloc(); [ 149s] | ^~~~~~ [ 149s] /usr/include/stdlib.h:675:14: error: conflicting types for 'calloc'; have 'void *(size_t, size_t)' {aka 'void *(unsigned int, unsigned int)'} [ 149s] 675 | extern void *calloc (size_t __nmemb, size_t __size) [ 149s] | ^~~~~~ [ 149s] dfa.c:37:14: note: previous declaration of 'calloc' with type 'char *()' [ 149s] 37 | extern char *calloc(), *malloc(), *realloc(); [ 149s] | ^~~~~~ [ 149s] /usr/include/stdlib.h:683:14: error: conflicting types for 'realloc'; have 'void *(void *, size_t)' {aka 'void *(void *, unsigned int)'} [ 149s] 683 | extern void *realloc (void *__ptr, size_t __size) [ 149s] | ^~~~~~~ [ 149s] dfa.c:37:36: note: previous declaration of 'realloc' with type 'char *()' [ 149s] 37 | extern char *calloc(), *malloc(), *realloc(); Change-Id: I7ce59a7bd2378ff0e987ffe102ca38890cda78fa Signed-off-by: Dongkyun Son --- dfa.c | 1 - 1 file changed, 1 deletion(-) diff --git a/dfa.c b/dfa.c index ae170ad..b8117e7 100644 --- a/dfa.c +++ b/dfa.c @@ -34,7 +34,6 @@ #ifdef STDC_HEADERS #include #else -extern char *calloc(), *malloc(), *realloc(); extern void free(); #endif -- 2.34.1