Skip to content

Conversation

@MarcioBulla
Copy link
Contributor

Description

This pull request fixes compilation errors in the espressif__knob component.

The Clang compiler was producing errors due to incorrect use of the logical NOT operator ! applied directly before a comparison (== 0), which caused ambiguity and warnings treated as errors.

To resolve this, parentheses were added around the expression to clarify the intended logic. Additionally, the <stdbool.h> header was included in iot_knob.h to properly define the bool type, which was previously causing an unknown type error during compilation.


Related

No specific open issues related to this PR.
This PR addresses build errors that prevented using the espressif__knob component with recent versions of Clang (esp-clang version esp-18.1.2_20240912).


Testing

The firmware was compiled locally using the ESP-IDF toolchain with Clang 18.1.2 without any compilation errors.
The functionality of the espressif__knob component was tested in the application and behaved as expected.


Checklist

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GitHub Actions) pass.
  • Documentation is updated as needed (not applicable for this fix).
  • Tests are updated or added if necessary (not applicable).
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are concise and minimal.

@CLAassistant
Copy link

CLAassistant commented Jul 18, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link

Fails
🚫

node failed.

Log

┌─────────┬─────────────────────────────────────┬───────────────────────────────────────────────────────┬────────────────┐
│ (index) │             CiVariable              │                         Value                         │ CustomSettings │
├─────────┼─────────────────────────────────────┼───────────────────────────────────────────────────────┼────────────────┤
│    0    │  'ENABLE_RULE_PR_COMMIT_MESSAGES'   │                         true                          │   'default'    │
│    1    │    'ENABLE_RULE_PR_DESCRIPTION'     │                         true                          │   'default'    │
│    2    │     'ENABLE_RULE_PR_SIZE_LINES'     │                         true                          │   'default'    │
│    3    │ 'ENABLE_RULE_PR_SOURCE_BRANCH_NAME' │                         true                          │   'default'    │
│    4    │   'ENABLE_RULE_PR_TARGET_BRANCH'    │                         true                          │   'default'    │
│    5    │  'ENABLE_RULE_PR_TOO_MANY_COMMITS'  │                         true                          │   'default'    │
│    6    │    'ENABLE_OUTPUT_INSTRUCTIONS'     │                         true                          │   'default'    │
│    7    │             'CLA_LINK'              │                          ''                           │   'default'    │
│    8    │   'COMMIT_MESSAGE_ALLOWED_TYPES'    │ 'change,ci,docs,feat,fix,refactor,remove,revert,test' │   'default'    │
│    9    │      'CONTRIBUTING_GUIDE_FILE'      │                          ''                           │   'default'    │
│   10    │   'IGNORED_SECTIONS_DESCRIPTION'    │              'related,release,breaking'               │   'default'    │
│   11    │         'IS_GITLAB_MIRROR'          │                         false                         │   'default'    │
│   12    │   'MAX_COMMIT_MESSAGE_BODY_LINE'    │                          100                          │   'default'    │
│   13    │    'MAX_COMMIT_MESSAGE_SUMMARY'     │                          72                           │   'default'    │
│   14    │         'MAX_COMMITS_WARN'          │                           5                           │   'default'    │
│   15    │            'MAX_COMMITS'            │                           2                           │   'default'    │
│   16    │           'MAX_PR_LINES'            │                         1000                          │   'default'    │
│   17    │    'MIN_COMMIT_MESSAGE_SUMMARY'     │                          20                           │   'default'    │
│   18    │     'MIN_PR_DESCRIPTION_LENGTH'     │                          50                           │   'default'    │
└─────────┴─────────────────────────────────────┴───────────────────────────────────────────────────────┴────────────────┘
Error:  RequestError [HttpError]: API rate limit exceeded for 68.154.54.34. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)
    at /node_modules/@octokit/request/dist-node/index.js:86:21
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  status: 403,
  response: {
    url: 'https://api.github.com/repos/espressif/esp-iot-solution',
    status: 403,
    headers: {
      'access-control-allow-origin': '*',
      'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-RateLimit-Used, X-RateLimit-Resource, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset',
      connection: 'close',
      'content-length': '278',
      'content-security-policy': "default-src 'none'; style-src 'unsafe-inline'",
      'content-type': 'application/json; charset=utf-8',
      date: 'Fri, 18 Jul 2025 04:16:38 GMT',
      'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
      server: 'Varnish',
      'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
      'x-content-type-options': 'nosniff',
      'x-frame-options': 'deny',
      'x-github-media-type': 'github.v3; format=json',
      'x-github-request-id': '93C1:D3018:B1A29A:166C154:6879CAA6',
      'x-ratelimit-limit': '60',
      'x-ratelimit-remaining': '0',
      'x-ratelimit-reset': '1752812697',
      'x-ratelimit-resource': 'core',
      'x-ratelimit-used': '60',
      'x-xss-protection': '1; mode=block'
    },
    data: {
      message: "API rate limit exceeded for 68.154.54.34. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)",
      documentation_url: 'https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting'
    }
  },
  request: {
    method: 'GET',
    url: 'https://api.github.com/repos/espressif/esp-iot-solution',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'octokit-rest.js/18.12.0 octokit-core.js/3.6.0 Node.js/18.15.0 (linux; x64)'
    },
    request: { hook: [Function: bound bound register] }
  }
}
danger-results://tmp/danger-results-db4b1716.json

Generated by 🚫 dangerJS against 5276b26

@github-actions github-actions bot changed the title fix: add #include <stdbool.h> and parentheses fix: add #include <stdbool.h> and parentheses (AEGHB-1143) Jul 18, 2025
@leeebo leeebo self-requested a review July 23, 2025 10:48
Copy link
Collaborator

@leeebo leeebo left a comment

Choose a reason for hiding this comment

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

Hi @MarcioBulla, the fix looks good to me. Thanks for your contribution!

@leeebo leeebo added the knob label Jul 23, 2025
@leeebo
Copy link
Collaborator

leeebo commented Jul 24, 2025

sha=5276b266784ad28c9e6108572a388439fdc7e7ca

@zhanzhaocheng zhanzhaocheng merged commit fa43acc into espressif:master Jul 25, 2025
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants