Hi Alan,

> The problem is not the "const" as the error message suggest, the
> problem is the "rom" before it.
> 
> This code works fine:
> 
> typedef const struct _rom_desc_tsk
> {
>        unsigned char prioinit;
>        ...
> } rom_desc_tsk;

As indeed it should according to the ANSI C specification... I just
guessed that you had removed the rom keyword and it still did not work.

> I agree with you the best way is just "typedefining" the struct and
> using const when declaring the variable, anyway this code is not mine,
> I want just compile it using SDCC :-D
> 
> How can I define the "rom" word using SDCC ?

Well, you could use
  #define rom   /* ignored */
or (probably semantically closer)
  #define rom   __code
prior to the declarations. The latter allocates the constant struct in
code memory (Flash or EEPROM).

Better luck this time,
Raphael


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to