CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

4.033 compiler warning about the rs232_error

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Jim
Guest







4.033 compiler warning about the rs232_error
PostPosted: Sun May 27, 2007 1:44 am     Reply with quote

Hi,
Does anyone know why the 4.033 verion generate a warning when using
#USE RS232(BAUD=4800, XMIT=PIN_C6, RCV=PIN_C7, stream=PORT1, ERRORS)?
Warning = "variable never used rs232_error"

Even with the warning, I hope the new compiler will automatic generate the code reset the error?

.................... #USE RS232(BAUD=4800, XMIT=PIN_C6, RCV=PIN_C7, stream=PORT1, ERRORS)
*
00C2E: BTFSS F9E.5
00C30: GOTO 0C2E
00C34: MOVF FAB,W
00C36: MOVWF 1A
00C38: MOVF FAE,W
00C3A: MOVWF 01
00C3C: BTFSS 1A.1
00C3E: GOTO 0C46
00C42: BCF FAB.4
00C44: BSF FAB.4
00C46: GOTO 0C4E (RETURN)
Ttelmah
Guest







PostPosted: Sun May 27, 2007 2:59 am     Reply with quote

The older compilers will do this as well, depending on the level you have 'warnings' set at.
What has happened, is that the newer compilers _default_ to a higher 'warning' level, and warn you now, if you have a variable declared but not used (note _warn_, not 'error'). As soon as 'errors' is added, the variable RS232_ERRORS', gets declared, reflecting the error status of the UART, and you will see this warning.
You can use:
#IGNORE_WARNINGS ALL

To make the behaviour be like the old compiler.

Best Wishes
Guest








PostPosted: Sun May 27, 2007 1:17 pm     Reply with quote

Ttelmah,
Thank you so much for your reply. With the old compiler, I see in the assembly code, it does user the variable rs232_error.
With the new compiler, the variable is replayed by 1A.
Jim
Ttelmah
Guest







PostPosted: Sun May 27, 2007 3:09 pm     Reply with quote

Not if you use the value.
What is happening here is separate from the 'warning', but tied to it. The compiler sees you don't use the value, so optimises it out of existence. However the error clearing code remains.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group