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

stdint.h usage with string functions

If I include "stdint.h", allocate a pointer of type "int8_t" and then

int8_t *ptr = strtok(...)

I get a compiler warning:

#513-D: a value of type "char *" cannot be assigned to an entity of type "int8_t *"

so if I want to declare a pointer to a string, I must always use "char" to prevent the warning? is there another "type" to facilitate portability?

Parents
  • Is there a reason why you see a problem with using "char" when interacting with functions that the language standard says are operating on char?

    For compilers that supports wide characters, there are more character data types. But they are used with string functions with different names. And there may then also be macros to handle switching between characters and wide characters at the same time as switching between string functions operating of characters and string functions operating on wide characters.

    Are you coding using the MISRA standard?

Reply
  • Is there a reason why you see a problem with using "char" when interacting with functions that the language standard says are operating on char?

    For compilers that supports wide characters, there are more character data types. But they are used with string functions with different names. And there may then also be macros to handle switching between characters and wide characters at the same time as switching between string functions operating of characters and string functions operating on wide characters.

    Are you coding using the MISRA standard?

Children