Fix build error : conflicting types for 'malloc'; 16/311316/2 accepted/tizen_9.0_base accepted/tizen_base accepted/tizen_base_asan accepted/tizen_base_dev accepted/tizen_base_toolchain accepted/tizen_base_x accepted/tizen_base_x_asan tizen_9.0_base tizen_base accepted/tizen/9.0/base/20241030.075147 accepted/tizen/base/20240612.043256 accepted/tizen/base/asan/20240806.090136 accepted/tizen/base/dev/20241206.041111 accepted/tizen/base/toolchain/20240604.070917 accepted/tizen/base/x/20240612.012422 accepted/tizen/base/x/asan/20240624.231429 tizen_9.0_m2_release
authorDongkyun Son <dongkyun.s@samsung.com>
Fri, 17 May 2024 11:10:00 +0000 (20:10 +0900)
committerDongkyun Son <dongkyun.s@samsung.com>
Tue, 28 May 2024 23:56:27 +0000 (08:56 +0900)
commitba92efcbab032a7b8ca0f06cdb618e6837e337a0
tree9c6bd3bb9a3d57563699f6abb1c6d50aae9ac59a
parent766c7549ad9f6737d9a237de2de7e4e3f6f0b4c8
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 '<stdlib.h>'
[  149s]    30 | #include <sys/types.h>
[  149s]   +++ |+#include <stdlib.h>
[  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 '<stdlib.h>'
[  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 '<stdlib.h>'
...
[  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 <dongkyun.s@samsung.com>
dfa.c