View previous topic :: View next topic |
Author |
Message |
E_Blue
Joined: 13 Apr 2011 Posts: 417
|
There is a way to set compiler case sensitive? |
Posted: Fri Aug 24, 2018 12:35 pm |
|
|
I make some mistakes in my code and wrote some variables in different case than was declared, so now I want to clean it.
I know the compiler doesn´t complain about but any way I want to clean the code.
So, There is a way to set compiler case sensitive to get a warning and or and error code at compile results? _________________ Electric Blue |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Aug 24, 2018 12:47 pm |
|
|
Download the CCS manual. Search it for: case
Then go to that page. |
|
|
E_Blue
Joined: 13 Apr 2011 Posts: 417
|
|
Posted: Fri Aug 24, 2018 1:12 pm |
|
|
Thanks.
I did it but now I get a lot of "Undefined identifier false" _________________ Electric Blue |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Aug 24, 2018 1:15 pm |
|
|
Post some of the source lines that are pointed to by the error messages.
Also post the error messages. |
|
|
E_Blue
Joined: 13 Apr 2011 Posts: 417
|
|
Posted: Fri Aug 24, 2018 1:29 pm |
|
|
I just changed all the true, false to full uppercase(TRUE/FALSE) and work ok. _________________ Electric Blue |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Fri Aug 24, 2018 1:30 pm |
|
|
All that means is the code you are loading/typing has got the case wrong on some if it's identifiers....
Remember if you select #case, you have to get the case right for all the calls to standard functions as well.
It looks as if you have used the word 'False' for logic false, rather than the keyword, which is FALSE. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Fri Aug 24, 2018 6:09 pm |
|
|
comment:
I seem to recall that when you enable 'CASE' it ALSO changes the default of variables to become signed integers instead of the CCS normal default of unsigned
This 'fun' feature came to light when I was doing a 'chicken coop sunrise' program.It took a lot of head scratching to understand why some parts of the code that 'used to work fine' didn't.....
As to WHY enabling CASE did it is baffling, I got the program running and went on to the next client's mess....
Jay |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Aug 24, 2018 6:52 pm |
|
|
Quote: | it changes the default of variables to become signed integers | Nope. That's ANSI. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Fri Aug 24, 2018 8:12 pm |
|
|
Yeah, that's the headache......sigh...
All I remember is it was quite aggrevating. As I was never formally taught C, I didn't understand whatr I was doing wrong.
Code worked, didn't work, change this and that, was led down a few deadend roads trying to figure out what I'd done wrong, assuming I had done 'something' wrong. Eventually I recoded all the variables to get rid of the mix of upper and lower case, got rid of ANSI and magically the program worked.
I do recall freeing up a lot of disc space getting rid of the 200+ versions, shaking my head, saying all this time and effort just to please a dozen hens to have fresh eggs....
Jay |
|
|
jeremiah
Joined: 20 Jul 2010 Posts: 1354
|
|
Posted: Tue Sep 04, 2018 6:57 am |
|
|
temtronic wrote: | Yeah, that's the headache......sigh...
All I remember is it was quite aggrevating. As I was never formally taught C, I didn't understand whatr I was doing wrong.
Code worked, didn't work, change this and that, was led down a few deadend roads trying to figure out what I'd done wrong, assuming I had done 'something' wrong. Eventually I recoded all the variables to get rid of the mix of upper and lower case, got rid of ANSI and magically the program worked.
I do recall freeing up a lot of disc space getting rid of the 200+ versions, shaking my head, saying all this time and effort just to please a dozen hens to have fresh eggs....
Jay |
It was really fun for PCD. Somewhere in the late 4.x era, they changed PCD's default to signed and we didn't know. Recompiled our code with some new features and old untouched stuff stopped working randomly. Found out it was an IF comparing a character to a number (something like if(c == 0xFF) which sign extended the c var and 0 extended the number). |
|
|
E_Blue
Joined: 13 Apr 2011 Posts: 417
|
|
Posted: Wed Sep 05, 2018 8:12 am |
|
|
Ttelmah wrote: |
It looks as if you have used the word 'False' for logic false, rather than the keyword, which is FALSE. |
I think that I don't understand what's the difference.
I'm using TRUE & FALSE like this.
Code: |
short enabled=FALSE;
if(enabled)
{
enabled=FALSE;
}
else
{
enabled=TRUE;
} |
_________________ Electric Blue |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Wed Sep 05, 2018 9:08 am |
|
|
Yes, now, but the reason for it failing was that you had it typed in lower case somewhere. The compiler was telling you what was wrong:
Quote: |
did it but now I get a lot of "Undefined identifier false"
|
You obviously had used 'false' rather than 'FALSE', so when case significance was enabled, it complained... |
|
|
E_Blue
Joined: 13 Apr 2011 Posts: 417
|
|
Posted: Fri Sep 07, 2018 9:22 am |
|
|
Ttelmah wrote: |
You obviously had used 'false' rather than 'FALSE', so when case significance was enabled, it complained... |
It was ALL in lowercase, I didn't know that must be typed in uppercase.
I program JAVA code too that uses false & true in lowercase so I guess it must be in lower case. _________________ Electric Blue |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Fri Sep 07, 2018 9:49 am |
|
|
No such thing as a 'standard' these days.
I still expect to see 25 pin RS-232 connectors on PCs. |
|
|
E_Blue
Joined: 13 Apr 2011 Posts: 417
|
|
Posted: Fri Sep 07, 2018 1:09 pm |
|
|
temtronic wrote: | No such thing as a 'standard' these days.
I still expect to see 25 pin RS-232 connectors on PCs. |
So many languages, environments, IDES, protocols.....
Everybody tries to create its own standard. _________________ Electric Blue |
|
|
|