[splint-discuss] SFR definition acceptable to SPLINT

juan abba jjose at globo.com
Tue Aug 21 14:24:43 EDT 2007


I appreciate a lot your fast, simple and effective answer.
It works 100% for most SFR Address I am using.
for some reason that I do not understand it requires "not for all, but 
just for a few of them", on one of the C files, an additional 
declaration like:

 #if defined S_SPLINT_S
char unsigned PCADDR , PCCTL, PCIN, PCOUT;
#endif

but as I said, it works 100%
thanks again
juan




Ludolf Holzheid wrote:
> On Tue, 2007-08-21 12:41:42 -0300, juan abba wrote:
>   
>> [..]
>> I am trying to find a way to use following
>>
>> #if defined S_SPLINT_S
>> #define PCADDR                 char *unsigned char *
>> #else
>> #define PCADDR  (*(unsigned char volatile far*)0xFD8)              // 
>> Port C Address
>> #endif
>>     
>
>
> Hello Juan,
>
> I don't understand the definition you made for splint.
>
> The definition for the Zilog compiler says something like 'take 0xFD8
> as an address of an unsigned char variable and access this variable'.
> So, I think, the symbol 'PCADDR' is to be used e.g. as follows:
>
>   PCADDR = 0x03;
>
> or
>
>   if (0x00 != (PCADDR & 0x04))
>   {
>      ...
>   }
>
>
> Why don't you declare an unsigned char named 'PCADDR' to make splint
> happy?
>
> # if defined S_SPLINT_S
>     extern unsigned char PCADDR;
> # else
> #   define PCADDR  (*(unsigned char volatile far*)0xFD8)
> # endif
>
> HTH,
>
> Ludolf
>
>
>   


-- 
Amigo, antes de lhe enviar este e-mail tive o cuidado de remover 
todos os endereços que porventura vieram no texto original. 
Fiz isto para eliminar o risco de hackers extraírem os e-mails que 
vieram junto com a mensagem e os utilizarem para envio de "spam".

Sugiro que se for re-enviar este e-mail tome o mesmo cuidado e, 
mais, como segurança adicional, endereçem seus amigos no campo 
Cco ou Bcc. 
Você os estará protegendo e a si mesmo.
Juan Jose

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.cs.virginia.edu/pipermail/splint-discuss/attachments/20070821/4b933a23/attachment-0001.html 


More information about the splint-discuss mailing list