From: Dongkyun Son Date: Fri, 17 May 2024 11:10:00 +0000 (+0900) Subject: Fix build error : conflicting types for 'malloc'; X-Git-Tag: accepted/tizen/base/toolchain/20240604.070917^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_base;p=product%2Fupstream%2Fgawk.git 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 --- 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