Jump to content
Sign in to follow this  
king2

Compile warnings

Recommended Posts

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

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×