-
Notifications
You must be signed in to change notification settings - Fork 8.2k
net: Move include files outside of extern "C" block #18023
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
net: Move include files outside of extern "C" block #18023
Conversation
pabigot
left a comment
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.
Looks good assuming there are no additional #includes later in a header (I haven't checked).
Thanks for stepping up.
|
This PR doesn't seem to fix any bug (no "Fixes: " header). And neither the commit message not referenced #17997 explain what issue is being fixed either. |
@pfalcon It fixes linkage errors when including one of these header files in a C++ module. Before the original PR #17993 (referenced in #17997), this was the exact error message (thrown by GCC): Sorry for not mentioning this in the commit message. |
|
@mrfuchs: Thanks for explanation. Yes, it would have been good if more details went into the commit message. |
This is related to findings in zephyrproject-rtos#17997 and changes network related header files to have include files outside of extern "C" { } block. Declarations that use C linkage should be placed within extern "C" so the language linkage is correct when the header is included by a C++ compiler. Similarly #include directives should be outside the extern "C" to ensure the language-specific default linkage is applied to any declarations provided by the included header. See: https://en.cppreference.com/w/cpp/language/language_linkage Signed-off-by: Jukka Rissanen <[email protected]>
e12a0c5 to
f341c78
Compare
|
Updated the commit message. |
pfalcon
left a comment
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.
Updated the commit message.
Thanks!
|
The backport to To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub.
git fetch
# Create new working tree.
git worktree add .worktrees/backport v1.14-branch
# Navigate to the new directory.
cd .worktrees/backport
# Cherry-pick all the commits of this pull request and resolve the likely conflicts.
git cherry-pick f341c7862a803457a2d394fd64b2364033aa1fce
# Create a new branch with these backported commits.
git checkout -b backport-18023-to-v1.14-branch
# Push it to GitHub.
git push --set-upstream origin backport-18023-to-v1.14-branch
# Go back to the original working tree.
cd ../..
# Delete the working tree.
git worktree remove .worktrees/backportThen, create a pull request where the |
This is related to findings in #17997 and changes network
related header files to have include files outside of
extern "C" { } block.
Signed-off-by: Jukka Rissanen [email protected]