This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

const *char returns versus *char returns

We have been moving our design from 8051 to ARM Cortex. I am seeing an error complaining that the return type does not match.

error: #120: return value type does not match the function type

static char *func(void);

In this function we may return a pointer to a const *char or *char. I can cast my way out of this but is this a good way of fixing the problem? We did not see this error with the Keil 8051 compiler only with the Keil ARM compiler. Not that it is a compiler problem. I don't want to run into a compilation problem with a version change.