View previous topic :: View next topic |
Author |
Message |
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
Creating pointers to constants in PCD |
Posted: Fri Aug 29, 2008 3:50 am |
|
|
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 |
Posted: Fri Aug 29, 2008 12:03 pm |
|
|
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
|
|
Posted: Fri Aug 29, 2008 1:49 pm |
|
|
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
|
|
Posted: Fri Aug 29, 2008 4:39 pm |
|
|
Thanks, apparently, PCD isn't understanding the rom storage class modifier, at least not as synonymous for flash access. |
|
|
|