Skip to content

[BUG] Missing cast ( BaseType_t ) on portGET_CORE_ID #1299

@mike919192

Description

@mike919192

Describe the bug
I have been going through my custom SMP port and cleaning up warnings. I believe there is a missing ( BaseType_t ) cast in the kernel code here. Every other use of portGET_CORE_ID() in tasks.c has this cast.

My portGET_CORE_ID() implementation returns unsigned int. I followed the example of the RP2040 port which also returns the same type.

The warning message:

portmacro.h:106:34: warning: conversion to 'BaseType_t' {aka 'const long int'} from 'unsigned int' may change the sign of the result [-Wsign-conversion]
  106 |     #define portGET_CORE_ID()    get_core_num()
      |                                  ^~~~~~~~~~~~
tasks.c:896:43: note: in expansion of macro 'portGET_CORE_ID'
  896 |         const BaseType_t xCurrentCoreID = portGET_CORE_ID();

Target

  • Development board: Avnet Microzed
  • Instruction Set Architecture: armv7
  • IDE and version: Xilinx Vitis 2024.2
  • Toolchain and version: arm-none-eabi-gcc13.3.0

Host

  • Host OS: Windows
  • Version: 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions