king2 Posted July 20, 2018 Report Share Posted July 20, 2018 JFYI: gdisp.c, assign sedge, eedge, startTen, endTan: Warning[Pa093]: implicit conversion from floating point to integer. (float) needs to be added before rvalue. gtimer.c: THREAD_RETURN(0) after while(1) raises Warning[Pe111]: statement is unreachable gwin.c: _gwinDrawEnd(gh) after return in gwinGetPixelColor - same warning Link to comment Share on other sites More sharing options...
inmarket Posted August 4, 2018 Report Share Posted August 4, 2018 The implicit conversion warning is just that, a warning. It is perfectly valid C and perscribed behaviour for the C language. That the compiler is warning is being overly cautious and should be ignored. The reality is that the code is perfectly fine and is 100% valid C. The gtimer.c warning is a situation of dammed if you do and dammed if you don't. As gtimer is run as a thread process most operating systems require a return value for the function. So even though the code is unreachable most compilers will complain if you don't have a suitable return statement. On the other hand most compilers don't bother to complain about unreachable code in that situation unless the warning levels are set too high. So, in either case you will get a warning message from the compiler. You are just less likely to get a warning the way we have coded it. Without checking the code I suspect the gwin.c situation is the same. In summary, the code is fine. If the warnings bother you then turn down the warning level on the compiler. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now