Reputation: 207
I am trying to run to following function as part of a bigger project:
#include <memory.h>
void bzero(char *s, int n)
{
memset (s, 0, n);
}
I am getting the following error: "Conflicting types for 'bzero'"
I don't understand the problem, since the entire projects works fine on Linux. So I am actually trying to transfer it onto Mac and to create and executable file using Xcode, but it won't even built.
Upvotes: 1
Views: 4513
Reputation: 106012
bzero
is a non-standard C function used in system programming and that's causing the conflict on your system. It has prototype
void bzero(void *s, size_t n);
Upvotes: 0
Reputation: 145829
In your system there is already a bzero
function (a legacy POSIX function that is now removed) with a different prototype. Name your function differently like my_bzero
.
Upvotes: 4