In a project I'm working on, I seem to have come across an warning I don't think I've seen before:The culprit is this line: My smash_space function is this: Clearly, my compiler is complaining about the type of information being passed into the function. Any ideas on how I can resolve this warning? It works properly, but I hate having warnings in my code.
warning: passing arg 1 of `smash_space' discards qualifiers from pointer target type fprintf( fp, "%s.race\n", smash_space(race_table[count].race_name) );char *smash_space( char *str )
{
static char ret[MAX_STRING_LENGTH];
char *retptr;
retptr = ret;
for ( ; *str != '\0'; str++ )
{
if (*str == ' ' )
continue;
else
{
*retptr = *str;
retptr++;
}
}
*retptr = '\0';
return ret;
}