![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
Jim Guest
|
4.033 compiler warning about the rs232_error |
Posted: Sun May 27, 2007 1:44 am |
|
|
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) |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Sun May 27, 2007 2:59 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
Guest
|
|
Posted: Sun May 27, 2007 1:17 pm |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Sun May 27, 2007 3:09 pm |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|