Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

comejv
Copy link
Contributor

@comejv comejv commented Aug 27, 2025

Summary

This commit fixes a typo in the capture.h header file (fix #16835).

Change: CAPIOC_FREQUENCE -> CAPIOC_FREQUENCY

Added a compiler warning of the deprecation to the capture.h file.

Updated capture driver and documentation.

Impact

Now shows a compiler warning when using the capture driver. Old spelling is aliased to the new spelling. Should be removed in future releases.

Testing

Built config capture on Ubuntu.

This commit fixes a typo in the capture.h header file (fix apache#16835).

Change: CAPIOC_FREQUENCE -> CAPIOC_FREQUENCY

Added a compiler warning of the deprecation to the capture.h file.

Updated capture driver and documentation.

Signed-off-by: CΓ΄me VINCENT <[email protected]>
@github-actions github-actions bot added Area: Documentation Improvements or additions to documentation Area: Drivers Drivers issues Size: S The size of the change in this PR is small labels Aug 27, 2025
#define CAPIOC_FREQUENCE CAPIOC_FREQUENCY

#if defined(__clang__)
#pragma clang deprecated("CAPIOC_FREQUENCE", "Use CAPIOC_FREQUENCY; CAPIOC_FREQUENCE will be removed on 2026-01-01")
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you the one that is going to remember and remove this on new year's day?

Copy link
Contributor

@acassis acassis left a comment

Choose a reason for hiding this comment

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

@comejv maybe it should better to create a DEPRECATED macro that accept the symbol/function and the due date. Also we could include a test the convert it in an error to alert people to remove that function case the due date has passed

/* Deprecated alias: keep object-like so existing code compiles unchanged */
#define CAPIOC_FREQUENCE CAPIOC_FREQUENCY

#if defined(__clang__)
Copy link
Contributor

Choose a reason for hiding this comment

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

not good to check compiler in the common code

@raiden00pl
Copy link
Member

Why not just correct the typo without any additional warnings and delete the old define?
This change will cause a compilation error anyway. This is an example of a breaking change that is trivial to fix and immediately visible when migrating to the new NuttX version. In such cases, complicating the process doesn't help at all and makes no sense to me.

@acassis
Copy link
Contributor

acassis commented Sep 3, 2025

@comejv just fix like raiden suggested and fix the typo CAPIOC_FREQUENCE. But I think the idea of creating a macro to define a DEPRECATED feature is interesting for letter maintenance and to warn users about APIs that will change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Documentation Improvements or additions to documentation Area: Drivers Drivers issues Size: S The size of the change in this PR is small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TYPO] drivers/timers/capture: CAPIOC_FREQUENCE is not standard english
6 participants