Skip to content

Non-static local-only function in async_context_XXX implementations #2678

@earlephilhower

Description

@earlephilhower

When running some other code with extra GCC warnings enabled (-Wmissing-declaration) it looks like one function in the async_context_threadsafe_background C-object should be static

In file included from /home/earle/Arduino/hardware/pico/rp2040/cores/rp2040/sdkoverride/async_context_threadsafe_background.c:2:
/home/earle/Arduino/hardware/pico/rp2040/cores/rp2040/sdkoverride/../../../pico-sdk/src/rp2_common/pico_async_context/async_context_threadsafe_background.c:138:10: warning: no previous declaration for 'async_context_threadsafe_background_execute_sync' [-Wmissing-declarations]
  138 | uint32_t async_context_threadsafe_background_execute_sync(async_context_t *self_base, uint32_t (*func)(void *param), void *param) {
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This function is only used as a function pointer in the async_context_type_t struct and not defined in a header for external use (nor should it be, async_context_execute_sync is the proper interface). Other functions assigned to this struct are all static, so it looks like just an oversight.

The same non-static state for only the execute function is present in async_context_poll and async_context_freertos.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions