![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
kdoney Guest
|
ANSI compliant |
Posted: Wed Aug 05, 2009 5:20 pm |
|
|
I was told by Microchip that I couldn't use your compiler with any of their libraries. The tcpip stack, the usb stack, the advanced graphic stack is all created with code which will not compile with ccs compiler. When I asked if their code and compiler were ANSI standard, they said yes. How can 2 ansi compatible compilers, with standard coding, be incapable of compiling the same program?
![Shocked](images/smiles/icon_eek.gif) |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Thu Aug 06, 2009 2:25 am |
|
|
Very easily.
The same applies between PC ANSI compilers, especially when you start to work down at the hardware level.
Code is dependant not only on the compiler 'rules', but also on libraries used, and assumptions made by the author. ANSI, makes it _easier_ to transport code between compilers, but customisation _will_ still be needed, for anything beyond the basic 'hello world' type program.
It is like two people reading a book written in English. One a mathematician, and one a psychiatrist. Though both are using the same 'language', the assumptions made by the former, if a 'mod' is referred to, may be very different from those of the latter.
At the very least, you need to have the initialisation headers different for the two compilers, and for CCS, include name definitions for the internal registers. Then, since both compilers contain keywords beyond the ANSI 'standard', which may have different definitions, or not exist at all in the other, you need to check for every single one of these, and either add the definitions, change the syntax, or change the name itself (if it clashes with an internal function).
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
Ken Johnson
Joined: 23 Mar 2006 Posts: 197 Location: Lewisburg, WV
|
|
Posted: Thu Aug 06, 2009 7:40 am |
|
|
Where did you get the idea that CCS is "ANSI standard" ?
It is not. It is "C-like", but much is not "standard".
Please correct if this is wrong
Ken |
|
![](templates/subSilver/images/spacer.gif) |
Wayne_
Joined: 10 Oct 2007 Posts: 681
|
|
![](templates/subSilver/images/spacer.gif) |
kdoney Guest
|
Thanks |
Posted: Thu Aug 06, 2009 9:11 am |
|
|
I don't mind a superset of names and functions as long as the conventions of the standards are maintained within the additions. When compiler directives no longer utilize the same tokens, it seems as if the "errors" were done on purpose. If I want to use the best library for advanced graphics, tcpip or usb, I need to spend $2000 for the range of Microchip compilers. ![Evil or Very Mad](images/smiles/icon_evil.gif) |
|
![](templates/subSilver/images/spacer.gif) |
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Thu Aug 06, 2009 9:53 am |
|
|
Quote: | I don't mind a superset of names and functions as long as the conventions of the standards are maintained within the additions. When compiler directives no longer utilize the same tokens, it seems as if the "errors" were done on purpose. | This is O.K., but mostly misses the point that's involved with compatibility of Microchip's libraries. As Ttelmah pointed out, it's a matter of low level language supplements not covered by any standard.
The availability of a particular, ready-to-use library can be a reason to opt for the Microchip (or another competitor's) toolchain. Others have choosen CCS just for the rich choice of existing drivers. |
|
![](templates/subSilver/images/spacer.gif) |
Guest
|
|
Posted: Thu Aug 06, 2009 4:51 pm |
|
|
Quote: | as long as the conventions of the standards are maintained |
Interesting - ANSI compliance is for the language elements - never for the hardware 'touching' layer. The reason C has been popular for sooooo many years is that it is a very good language for 'touching' hardware with. Even in my PC days I used Borland and Microsoft C - they were probably pretty close to ANSI - but none of the functions that touched the PC hardware were compatible. The ANSI standard does not define these aspects.
As others have said - you can pick one compiler over another based on the libraries that they supply. This is why I chose CCS,
1) Pretty much standard C
2) Very cost effective
3) Very efficient (compiled code wise - at least for me)
4) Has a bunch of really useful functions already written (delay_ms, RS232 serial, etc).
I think I've used C since probably 1989 and CCS since 1994 - that's pretty good leverage for any language.
My 2 cents worth - Steve H. |
|
![](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
|