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 CCS Technical Support

There is a way to set compiler case sensitive?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
E_Blue



Joined: 13 Apr 2011
Posts: 417

View user's profile Send private message

There is a way to set compiler case sensitive?
PostPosted: Fri Aug 24, 2018 12:35 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Aug 24, 2018 12:47 pm     Reply with quote

Download the CCS manual. Search it for: case
Then go to that page.
E_Blue



Joined: 13 Apr 2011
Posts: 417

View user's profile Send private message

PostPosted: Fri Aug 24, 2018 1:12 pm     Reply with quote

Thanks.
I did it but now I get a lot of "Undefined identifier false"
_________________
Electric Blue
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Aug 24, 2018 1:15 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Aug 24, 2018 1:29 pm     Reply with quote

I just changed all the true, false to full uppercase(TRUE/FALSE) and work ok.
_________________
Electric Blue
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Fri Aug 24, 2018 1:30 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Aug 24, 2018 6:09 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Aug 24, 2018 6:52 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Aug 24, 2018 8:12 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Sep 04, 2018 6:57 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Sep 05, 2018 8:12 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Sep 05, 2018 9:08 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Sep 07, 2018 9:22 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Sep 07, 2018 9:49 am     Reply with quote

No such thing as a 'standard' these days.
I still expect to see 25 pin RS-232 connectors on PCs. Very Happy
E_Blue



Joined: 13 Apr 2011
Posts: 417

View user's profile Send private message

PostPosted: Fri Sep 07, 2018 1:09 pm     Reply with quote

temtronic wrote:
No such thing as a 'standard' these days.
I still expect to see 25 pin RS-232 connectors on PCs. Very Happy


So many languages, environments, IDES, protocols.....
Everybody tries to create its own standard.
_________________
Electric Blue
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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