DJGPP Compiler Warning...
Posted: Sat Mar 08, 2003 5:10 pm
Can anyone give me any ideas on fixing this?warning: passing arg 1 of 'memcpy' discards qualifiers from pointer target type
The Place to Start for Operating System Developers
https://f.osdev.org/
Can anyone give me any ideas on fixing this?warning: passing arg 1 of 'memcpy' discards qualifiers from pointer target type
Code: Select all
const char *str = "Hello ";
mempcy(str, "World", 6);
Code: Select all
void *memcpy(void *dest, const void *src, size_t bytes);
Code: Select all
void *memcpy(void *dst_ptr, const void *src_ptr, unsigned count)
{
void *ret_val = dst_ptr;
const char *src = (const char *)src_ptr;
char *dst = (char *)dst_ptr;
for(; count != 0; count--)
*dst++ = *src++;
return ret_val;
}
Code: Select all
static volatile virtual_stream virtual_sessions[10];
FILE *retval = kmalloc(sizeof(FILE));
memcpy(&virtual_sessions[totalvirt].substream, retval, sizeof(FILE));
Code: Select all
typedef struct
{
char *truepath;
int objid;
FILE substream;
} virtual_stream;
typedef struct
{
int type, id;
int location;
int mode;
} FILE;