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

CCS PCM C compiler standard?

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



Joined: 17 Sep 2008
Posts: 10

View user's profile Send private message

CCS PCM C compiler standard?
PostPosted: Fri Jan 09, 2009 5:36 am     Reply with quote

Hi,
I'm using CCSC Compiler PCM Version 4.076.

Please could any one let me know on which ā€™Cā€™ standards CCS PCM C compiler is based? (ā€˜Cā€™ ISO/IEC 9899:90 or K&R or any other)

Thanks!
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Fri Jan 09, 2009 7:48 am     Reply with quote

Correction: See the response below

Last edited by dyeatman on Fri Jan 23, 2009 12:19 pm; edited 1 time in total
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Fri Jan 09, 2009 8:08 am     Reply with quote

Based on the CCS-C standard I would say...

Check the manual on '#device Compilation mode selection ', page 95 of the June-2008 manual. The default setting is CCS4 mode which is a mixture of K&R, ANSI, C++ and CCS specific extensions. Setting the mode to ANSI makes the compiler a (little bit) more compatible.

I've never seen a complete list of CCS4 mode to a ANSI deviations, but a few things that come to mind are:
- Case insensitive (can be enabled with the #case compiler control)
- Variables are unsigned by default (unless explicitly declared signed)
- Does not allow recursive functions (because of PIC's small stack)
- The 'const' qualifier makes the variable 'read only' AND places the data in Program memory. Selecting ANSI mode will locate the variable in RAM at the expense of extra memory usage.
- Has some C++ features like 'reference parameters', 'default parameters' and 'overloaded functions'.
- Has numerous extensions to support the PIC hardware.

Please remember that because of the PIC specific hardware requirements none of the available PIC compilers will be fully ANSI compliant.

On a general note you can say that the larger companies like IAR and HI-Tech are more ANSI compatible because their compiler core is used for more processors but this comes at the cost of a less optimised code. A great feature of the CCS compiler is the automatic variable memory mapping and reuse, this is a feature all 'large compilers' are missing.
Nandus2000



Joined: 17 Sep 2008
Posts: 10

View user's profile Send private message

PostPosted: Fri Jan 23, 2009 11:52 am     Reply with quote

It is based on ANS/ISO 9899-1990: confirmed by support@ccsinfo.com
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jan 23, 2009 2:03 pm     Reply with quote

Just a hint. You should take a close look at ckielstra's post rather than
what you want to believe.
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