generated from amazon-archives/__template_MIT-0
-
Notifications
You must be signed in to change notification settings - Fork 206
Minor warning fixes #589
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
Merged
Merged
Minor warning fixes #589
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6cfc758
Eliminate compiler unused parameter warning
ChristosZosi 43ab28b
Eliminate compiler unused variable warnings
ChristosZosi 5665b9d
Eliminate compiler unused function warning
ChristosZosi 9829705
Rework callback setups in the EMAC-driver of the Xilinx UltraScale port
ChristosZosi bf1b30b
Uncrustify: triggered by comment.
actions-user 24d6a76
Update source/portable/NetworkInterface/xilinx_ultrascale/x_emacpsif_…
ChristosZosi ba1f887
Apply suggestions from code review
ChristosZosi 2a01c42
Merge branch 'FreeRTOS:main' into warnings
ChristosZosi 398ff8c
Merge branch 'main' into warnings
ChristosZosi 773596f
Merge branch 'main' into warnings
ChristosZosi bd4c4e9
Address comments from reviews
ChristosZosi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I missed this change: why would you remove the function calls and replace them with direct assignments?
Was there a problem with the functions? Or did it introduce a dependency on sources?
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.
Hello @ChristosZosi,
I agree with Hein here. I am also not sure why was this removed?
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.
In the commit message (9829705) I did add an explanation why the calls to the
XEmacPs_SetHandleris problematic. In short, the compiler would output the pedantic warningISO C forbids conversion of object pointer to function pointer type, when compiled with-Wpedantic.The reason for it has to do with the function prototype of
XEmacPs_SetHandlerHere you can see that the third parameter of the function is a
void-pointer. However we pass to the function a function pointer. And here lies the issue, that function pointers (text) are not the same as void pointers (data). That is the reason for the compiler warning.Here is also a nice discussion on stack overflow, which addresses this exact issue https://stackoverflow.com/questions/36645660/why-cant-i-cast-a-function-pointer-to-void
I hope this explains it 😄.
Uh oh!
There was an error while loading. Please reload this page.
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.
Thank you for the URL and for the insights.
Actually I had the same problem when using
setsockopt()which has a parametervoid *optval. It was not allowed to pass a function pointer.As a solution, I introduced a struct called F_TCP_UDP_Handler_t that holds function pointers.
So let's go for your solution, assigning pointers directly.