John,

You guessed right. If you explicitly provide the memory type a const will
not be put in code memory. But everything in code memory is automatically
const.

Maarten

> Thanks Phillipp and Royce. Your suggestion
>
>             const char * const cmds[] = { Thw_cmd, Cnts_cmd, NULL };
>
> solved the problem. Both the strings and the array of pointers to them
> are in code space now. Still being fairly new to sdcc had not spotted
> section 3.4.1.8 in the docs. I am curious about one thing though, are
> /const /and /__code /synonymous or is there some slight difference
> between them - eg could /const /be applied to /__xdata /as off chip
> "RAM" could be implimented with flash or eprom? (or even /data/near /to
> indicate once initialised never changed)
>
> Thanks for the help,
> Regards,
> John
>
> Royce Pereira wrote:
>
>>Hi John
>>On Wed, 08 Nov 2006 01:03:30 +0530, John Pote
>> <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>>>Is it possible to have the compiler place the cmds[] array in code space
>>>as well? That being so how could I declare a function so it would take a
>>>pointer so such a const array of pointers to const strings?
>>>
>>>
>>
>>Have you read the SDCC user manual? This stuff (and other queries you
>> might want to post)is exhaustively discussed.
>>Particularly in section "3.4.1.8 Pointers to MCS51/DS390 specific memory
>> spaces"
>>
>>Regards,
>>--Royce
>>
>>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642_______________________________________________
> Sdcc-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sdcc-user
>


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to