Hi, I'm getting a warning when compiling the following code:
void printstr(unsigned char *string, volatile unsigned char *videoram) // Print a string
{
int i = 0;
while(string[i] != '\0')
{
videoram[2*i] = string[i];
videoram[1+(2*i)] = 0x07;
i++;
}
}
unsigned char *memset(unsigned char *dest, unsigned char val, int count) // Set bytes of destination string to value
{
int i;
for(i = 0; i < count; i++)
*dest++ = val;
return dest;
}
void kmain( void* mbd, unsigned int magic )
{
//gdt_install()
volatile unsigned char* videoram = (volatile unsigned char *) 0xb8000;
unsigned char string[] = "Hi";
memset(string, 'H', 2);
clear(videoram);
printstr(string, videoram);
}
The warnings are:
Source Files/kernel.c:12: warning: conflicting types for built-in function ‘memset’
Source Files/kernel.c:29: warning: pointer targets in passing argument 1 of ‘printstr’ differ in signedness
The code compiles fine, I was just wondering why I get the warnings. I checked the types and they seem fine. I'm using GCC on linux.