-
Notifications
You must be signed in to change notification settings - Fork 1.5k
drivers/timers/capture: fix typo in capture.h #16925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
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]>
#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") |
There was a problem hiding this comment.
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?
There was a problem hiding this 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__) |
There was a problem hiding this comment.
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
Why not just correct the typo without any additional warnings and delete the old define? |
@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. |
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.