Skip to content

fix conversion warning for GCC/ARM_CM4F #653

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion portable/GCC/ARM_CM4F/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ BaseType_t xPortStartScheduler( void )

#if ( configASSERT_DEFINED == 1 )
{
volatile uint32_t ulOriginalPriority;
volatile uint8_t ulOriginalPriority;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems okay but it needs to be done across multiple ports. Do you want to do that too or would you prefer us to do that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I have created #658 . Thanks.

volatile uint32_t ulImplementedPrioBits = 0;
volatile uint8_t * const pucFirstUserPriorityRegister = ( volatile uint8_t * const ) ( portNVIC_IP_REGISTERS_OFFSET_16 + portFIRST_USER_INTERRUPT_NUMBER );
volatile uint8_t ucMaxPriorityValue;
Expand Down
2 changes: 1 addition & 1 deletion portable/GCC/ARM_CM4F/portmacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#define portLONG long
#define portSHORT short
#define portSTACK_TYPE uint32_t
#define portBASE_TYPE long
#define portBASE_TYPE uint32_t
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's ok to change this to an unsigned type - it is meant to be signed as per every other port and as it has always been. Changing it will probably cause pain for many users. If it is changed, which I advise strongly against, it will also need to be changed in all the ARMv7-M and ARMv8-M ports.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

portBASE_TYPE is actually a deprecated type, kept only so application code still builds. Recent code should be using BaseType_t.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your review and information. Currently, It caused the compile error because the warnings are treated as errors. What is your suggestion to fix this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know which specific warning flag is giving you an error? The pedantic flag is something we've discussed removing in other repos in the past. If this is causing your issue - we might want to consider removing it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, which line is causing the error? Is it the kernel code or the application code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, this was -Wconversion flag in my application code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time to report back :)


typedef portSTACK_TYPE StackType_t;
typedef long BaseType_t;
Expand Down