View previous topic :: View next topic |
Author |
Message |
Nandus2000
Joined: 17 Sep 2008 Posts: 10
|
CCS PCM C compiler standard? |
Posted: Fri Jan 09, 2009 5:36 am |
|
|
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: 1933 Location: Norman, OK
|
|
Posted: Fri Jan 09, 2009 7:48 am |
|
|
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
|
|
Posted: Fri Jan 09, 2009 8:08 am |
|
|
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
|
|
Posted: Fri Jan 23, 2009 11:52 am |
|
|
It is based on ANS/ISO 9899-1990: confirmed by support@ccsinfo.com |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Jan 23, 2009 2:03 pm |
|
|
Just a hint. You should take a close look at ckielstra's post rather than
what you want to believe. |
|
|
|