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 support@ccsinfo.com

ANSI compliant

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







ANSI compliant
PostPosted: Wed Aug 05, 2009 5:20 pm     Reply with quote

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?

Evil or Very Mad Crying or Very sad Mad Shocked
Ttelmah
Guest







PostPosted: Thu Aug 06, 2009 2:25 am     Reply with quote

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
Ken Johnson



Joined: 23 Mar 2006
Posts: 197
Location: Lewisburg, WV

View user's profile Send private message

PostPosted: Thu Aug 06, 2009 7:40 am     Reply with quote

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
Wayne_



Joined: 10 Oct 2007
Posts: 681

View user's profile Send private message

PostPosted: Thu Aug 06, 2009 7:47 am     Reply with quote

A search reveals many things

http://www.ccsinfo.com/forum/viewtopic.php?t=37311&highlight=ansi
kdoney
Guest







Thanks
PostPosted: Thu Aug 06, 2009 9:11 am     Reply with 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. 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
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Thu Aug 06, 2009 9:53 am     Reply with quote

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.
Guest








PostPosted: Thu Aug 06, 2009 4:51 pm     Reply with quote

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.
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