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

Creating pointers to constants in PCD

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



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

Creating pointers to constants in PCD
PostPosted: Fri Aug 29, 2008 3:50 am     Reply with quote

Hello,

the PCD manual contains the below example:

Code:
Creating pointers to constants
const char *cptr;
cptr = string;

But the compiler doesn't accept const char as a pointer definition, it requests a = for a constant definition.

Is the manual text written by mistake or is the compiler implementation yet incomplete?

Regards,
Frank
mr7
Guest







Found the same
PostPosted: Fri Aug 29, 2008 12:03 pm     Reply with quote

Running version 4.068 I get the same result.

Code:

const char *cptr;
cptr = string;



Code:

Expecting an =
Expecting a (
Expecting a (
Expecting a declaration
Ttelmah
Guest







PostPosted: Fri Aug 29, 2008 1:49 pm     Reply with quote

Try ROM instead.
On the other (non PCD) compilers, pointers to constants will work, but _only_ in some compiler modes. ROM used in the same way as const, functions much better. It may work for PCD as well.

Best Wishes
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Fri Aug 29, 2008 4:39 pm     Reply with quote

Thanks, apparently, PCD isn't understanding the rom storage class modifier, at least not as synonymous for flash access.
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