We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all,
I would like to discover why the compiler issues warning #68 (integer conversion resulted in a change of sign) for the code below. It is issued only for -O3, "Optimize for Time" enabled and when the function is inlined (__inline keyword).
I have tried to cast anything which could be implicitly converted to int back to uint, but no chance to get rid of this warning.
armcc.exe V4.0.0.524
static __inline uint8_t IsDecDigit(char c) { return ( (c >= '0') && (c <= '9')); } ... static void UseIt(void) { char *name; ... /* Initialize the name to something useful */ ... if ( (IsDecDigit(name[3])) /* <- warning issued for this expression */ && (IsDecDigit(name[4])) && (IsDecDigit(name[5])) && (IsDecDigit(name[6])) { ... } }
Thanks for responses.
Regards Pavel
lets understand this as an semi-artificial example.
Please don't do that. And if you do, at least have the politeness to say so right away.
As is you're risking to waste other people's time on analyzing code that doesn't exhibit the problem in the first place.