S
srikar2097
174: struct node *head = malloc(sizeof(struct node)); /* A */
COMPILER WARNING:-
-------------------------------------
linked_list.c: In function 'append_as_tail':
linked_list.c:174: warning: incompatible implicit declaration of built-
in function 'malloc'
This is snippet from a program I was writing. I keep getting this
warning when ever I use malloc() as stated in label-A.
what is the problem here?
As I understand malloc() returns a pointer to void and it could be
typecasted to whatever data type malloc was used. But this
was for older versions of C. With ANSI C, I think there is no need to
do type casting. So what is the compiler bickering about ?
Thanks...
COMPILER WARNING:-
-------------------------------------
linked_list.c: In function 'append_as_tail':
linked_list.c:174: warning: incompatible implicit declaration of built-
in function 'malloc'
This is snippet from a program I was writing. I keep getting this
warning when ever I use malloc() as stated in label-A.
what is the problem here?
As I understand malloc() returns a pointer to void and it could be
typecasted to whatever data type malloc was used. But this
was for older versions of C. With ANSI C, I think there is no need to
do type casting. So what is the compiler bickering about ?
Thanks...