View previous topic :: View next topic |
Author |
Message |
eskimobob
Joined: 07 Feb 2009 Posts: 40
|
static ROM problem |
Posted: Tue Nov 24, 2009 5:49 am |
|
|
Last year I was in the process of porting the Microchip DDNS code to work with CCS - I got it compiling and working 90%. I've just decided to have a play with the code again to see if I can nail the problem however it will not compile with any version after 4.095
Something has changed in the compiler but looking at the documented change between 4.095 and 4.096 does not show me anything remotely useful.
Here's the code that versions after 4.095 are complaining about:
Code: |
static ROM WORD ddnsServicePorts[] =
{
80, // DYNDNS_ORG
80, // NO_IP_COM
80, // DNSOMATIC_COM
};
|
The reported error is: "Expecting a (" for the first line above.
Anyone know what has changed here? |
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Tue Nov 24, 2009 9:42 am |
|
|
Quite often the actual error is somewhere _above_ the stated error. Look just above to see if you can find anything.
Ronald |
|
|
Ttelmah Guest
|
|
Posted: Tue Nov 24, 2009 9:42 am |
|
|
What happens if you get rid of the satatic declaration.
I'd not expect to be able to use a static declaration, with a ROM declaration. The 'static' keyword, is telling the compiler that a writable variable, should be in RAM, that is not re-used in functaion calls. The ROM declaration is telling the compiler that this variable is fixed in ROM, and not writable. The two together, don't make any sense....
Best Wishes |
|
|
eskimobob
Joined: 07 Feb 2009 Posts: 40
|
|
Posted: Tue Nov 24, 2009 12:34 pm |
|
|
Thanks guys. I thought the simplest thing was to change it to the following:
Code: |
WORD DDNS_SERVICE_PORTS_DYNDNS_ORG = 80; //DYNDNS_ORG
WORD DDNS_SERVICE_PORTS_NO_IP_COM = 80; //NO_IP_COM
WORD DDNS_SERVICE_PORTS_DNSOMATIC_COM = 80; //DNSOMATIC_COM
|
That works fine. Obviously I have to have code later to switch select the right one into my variable but never mind. I may well end up leaving them all as port 80 anyway in which case I only need one.
No idea what the other code worked fine in earlier versions but now now |
|
|
|