On Tue, Sep 1, 2020 at 8:12 AM Bhindhiya Raja <bhindhiy...@tataelxsi.co.in.invalid> wrote:
> Hello Team, > > We are working on adding pre-check support for Renesas RX65N MCU. We are > getting the below warnings in the common files used across the Renesas MCUs > (M16, SH1 and RX65N). > > > 1. arch/renesas/src/common/up_blocktask.c: passing argument 2 of > ‘up_copystate’ discards ‘volatile’ qualifier from pointer target type > 2. arch/renesas/src/common/up_releasepending.c: passing argument 2 of > ‘up_copystate’ discards ‘volatile’ qualifier from pointer target type > 3. arch/renesas/src/common/up_reprioritizertr.c: passing argument 2 of > ‘up_copystate’ discards ‘volatile’ qualifier from pointer target type > 4. arch/renesas/src/common/up_unblocktask.c: passing argument 2 of > ‘up_copystate’ discards ‘volatile’ qualifier from pointer target type > 5. arch/renesas/src/common/up_doirq.c: assignment discards ‘volatile’ > qualifier from pointer target type > 6. arch/renesas/src/common/up_initialize.c: implicit declaration of > function ‘up_serialinit’ > 7. arch/renesas/src/common/up_usestack.c: assignment makes pointer from > integer without a cast > 8. net/mld/mld_group.c: label ‘errout_with_sem’ defined but not used > > The following modifications would resolve the above mentioned warnings. > > Warnings 1, 2, 3 and 4 mentioned above can be resolved by typecasting the > argument 2 of ‘up_copystate’ to the type of the actual parameter while > invoking the function as follows: > up_copystate(rtcb->xcp.regs, (uint32_t *)up_current_regs); > > Warning 5 can be resolved similarly by typecasting the variable upon > assignment as follows: > regs = (uint32_t *)g_current_regs; Should we cast away the volatile modifier or is this something that should be looked into? (i.e., should those functions be modified to take a volatile uint32_t *?) Warning 6 can be resolved by including the function declaration for > up_serialinit() in the header file up_internal.h. Warning 7 can be resolved by typecasting the variable top_of_stack to (void > *) as follows: > tcb->adj_stack_ptr = (void *)top_of_stack; > > Warning 8 can be resolved by removing the label 'errout_with_sem' as it is > simply defined but not used anywhere in the function. I will need to examine the code to be sure (I'm replying on my phone now) but the fix for 6 and 8 sounds reasonable. Unless these warnings are cleared, RX65N cannot be added to the pre-check > since due to the [-Werror] flag, the build fails. > As the above mentioned files are common files to m16 and sh1 architectures > also, can you confirm whether the above modifications are okay. I recommend to submit separate PRs for fixes 6 and 8. But I think the use of volatile modifiers needs to be looked at more closely. I prefer not to cast away volatile-ness unless no other choice. Also not sure about 7. Cheers, Nathan