Modus Toolbox Build Warning

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
JCD
Level 3
Level 3
50 sign-ins 25 sign-ins 10 replies posted

Hello to all,

I have build a project but there are some warnings & notes.

I want to revise the following warnings:

1、left shift count >= width of type [-Wshift-count-overflow]

JCD_0-1635495308967.png

2、listing the stack pointer register 'sp' in a clobber list is deprecated [-Wdeprecated]

JCD_1-1635495704084.png

Can you please help me to get rid of this warning?

Best Wishes,

JCD  

0 Likes
1 Solution
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi @JCD ,

1. I was not able to locate CY_STARTUP_CM0_DP_STATE and CY_STARTUP_IPC7_DP_OFFSET. Are these user defined macros? Also please let me know the modus toolbox version you are using as well.

2. I'm afraid this warning is due to the latest GCC compiler that is being used. If you refer to section 6.47.2.6 Clobbers and Scratch Registers of the "Extended Asm - Assembler Instructions with C Expression Operands" for GCC 10.3.0 (Modus Toolbox uses GCC 10.3.1), it is clearly mentioned that they are deprecating the use of stack pointer in the clobber list and in future version they may change this warning to an error. 

AlenAn14_0-1635830621432.png


I tried removing the clobber list in your code as below :

__asm volatile(" MSR msp, %[sp]\n"
" BX %[address]\n"::[sp]"r"(stackPointer),[address]"r"(address):);

This built without the stack pointer warning.

 

Hope this helps.

View solution in original post

0 Likes
3 Replies
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi @JCD ,

1. I was not able to locate CY_STARTUP_CM0_DP_STATE and CY_STARTUP_IPC7_DP_OFFSET. Are these user defined macros? Also please let me know the modus toolbox version you are using as well.

2. I'm afraid this warning is due to the latest GCC compiler that is being used. If you refer to section 6.47.2.6 Clobbers and Scratch Registers of the "Extended Asm - Assembler Instructions with C Expression Operands" for GCC 10.3.0 (Modus Toolbox uses GCC 10.3.1), it is clearly mentioned that they are deprecating the use of stack pointer in the clobber list and in future version they may change this warning to an error. 

AlenAn14_0-1635830621432.png


I tried removing the clobber list in your code as below :

__asm volatile(" MSR msp, %[sp]\n"
" BX %[address]\n"::[sp]"r"(stackPointer),[address]"r"(address):);

This built without the stack pointer warning.

 

Hope this helps.

0 Likes
JCD
Level 3
Level 3
50 sign-ins 25 sign-ins 10 replies posted

Hello AlenAn14,

Thanks for the explanation and the solution.

PREVIEW

Best Wishes,

JCD 

0 Likes
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Glad the solution helps.

Thank you for using Infineon products and please reach out to us in case of any further queries you may have on our products.

0 Likes