Skip to content

fix(eppp_link): Fix const qualifier violation in eppp_link (IDFGH-17135)#994

Draft
sudeep-mohanty wants to merge 1 commit intoespressif:masterfrom
sudeep-mohanty:fix/eppp-link-const-qualifier-violation
Draft

fix(eppp_link): Fix const qualifier violation in eppp_link (IDFGH-17135)#994
sudeep-mohanty wants to merge 1 commit intoespressif:masterfrom
sudeep-mohanty:fix/eppp-link-const-qualifier-violation

Conversation

@sudeep-mohanty
Copy link
Copy Markdown
Contributor

@sudeep-mohanty sudeep-mohanty commented Jan 22, 2026

Description

ESP-IDF MR 45069, 45375 enables -Wwrite-strings and -Werror=discarded-qualifiers in ESP-IDF CI builds. This PR fixes const qualifier violations in examples that use espressif/eppp_link managed component causing build failures.

Related


Note

Updates callback signature for const-correctness.

  • Change have_some_eppp_netif second parameter from void *ctx to const void *ctx to align with esp_netif_find_if usage and eliminate discarded-qualifiers warnings.

Written by Cursor Bugbot for commit 712e0a5. This will update automatically on new commits. Configure here.

Changed void *ctx parameter to const void *ctx to match esp_netif_find_if API signature that requires const void *ctx in the predicate function.
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jan 22, 2026

CLA assistant check
All committers have signed the CLA.

@sudeep-mohanty sudeep-mohanty changed the title fix(eppp_link): Fix const qualifier violation in have_some_eppp_netif fix(eppp_link): Fix const qualifier violation in eppp_link Jan 22, 2026
@github-actions github-actions bot changed the title fix(eppp_link): Fix const qualifier violation in eppp_link fix(eppp_link): Fix const qualifier violation in eppp_link (IDFGH-17135) Jan 22, 2026
@espressif-bot espressif-bot added the Status: Opened Issue is new label Jan 22, 2026
@david-cermak david-cermak self-assigned this Jan 27, 2026
Copy link
Copy Markdown
Collaborator

@david-cermak david-cermak left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

#endif

static bool have_some_eppp_netif(esp_netif_t *netif, void *ctx)
static bool have_some_eppp_netif(esp_netif_t *netif, const void *ctx)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

@sudeep-mohanty sudeep-mohanty Jan 27, 2026

Choose a reason for hiding this comment

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

Hello @david-cermak, That is true. The complementary internal GitLab MR !45375 has the required update.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Then we need some #ifdefs around it, right? Is the GL-MR targeted to v6.1?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, the GL MR is targeted to v6.1. I now realize that for the eppp_link update we would need some #ifdefs for it work with several IDF versions. Or perhaps, we could handle it in idf_component.yml somehow. I will explore. Setting this MR to draft state for now.

@david-cermak
Copy link
Copy Markdown
Collaborator

@sudeep-mohanty There a few ways to resolve this across multiple IDF versions, none of them is perfect tho

  1. #ifdefs based on IDF_VERSION macro -- would work on release branches, needs IDF MR sync with this PR
  2. typecast to the used callback -- defeats type correctness of C
  3. C++ traits magic

From my perspective the least evil is nr 3) -- implemented in #1000
(if we have C++ concepts the solution would be even nicer)

I'm marking this WIP for now

@david-cermak david-cermak marked this pull request as draft February 3, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants