Skip to content
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

RemoteInspectorSocketWin.cpp: warning: cast from 'struct sockaddr *' to 'struct sockaddr_in *' increases required alignment from 2 to 4 #15728

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

fujii
Copy link
Contributor

@fujii fujii commented Jul 11, 2023

f43f814

RemoteInspectorSocketWin.cpp: warning: cast from 'struct sockaddr *' to 'struct sockaddr_in *' increases required alignment from 2 to 4
https://bugs.webkit.org/show_bug.cgi?id=259096

Reviewed by Ross Kirsling.

clang-cl reported the following warning for Windows port.

> JavaScriptCore\inspector\remote\socket\win\RemoteInspectorSocketWin.cpp(172,33): warning: cast from 'struct sockaddr *' to 'struct sockaddr_in *' increases required alignment from 2 to 4 [-Wcast-align]
>             address.sin_addr = ((struct sockaddr_in*)(res->ai_addr))->sin_addr;
>                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* Source/JavaScriptCore/inspector/remote/socket/win/RemoteInspectorSocketWin.cpp:
(Inspector::Socket::connect): Use reinterpret_cast instead of C style cast to suppress the warning.

Canonical link: https://commits.webkit.org/265984@main

3f2e927

Misc iOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 wincairo
✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🛠 gtk
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🧪 gtk-wk2
✅ 🛠 🧪 jsc ✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🧪 api-gtk
✅ 🛠 🧪 jsc-arm64 ✅ 🛠 tv ✅ 🧪 mac-AS-debug-wk2 ✅ 🛠 jsc-armv7
✅ 🛠 tv-sim ✅ 🧪 jsc-armv7-tests
✅ 🛠 watch ✅ 🛠 jsc-mips
✅ 🛠 🧪 unsafe-merge ✅ 🛠 watch-sim ✅ 🧪 jsc-mips-tests

@fujii fujii requested a review from patrickangle as a code owner July 11, 2023 06:55
@fujii fujii self-assigned this Jul 11, 2023
@fujii fujii added the JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues. label Jul 11, 2023
@fujii fujii requested a review from rkirsling July 12, 2023 02:06
Copy link
Member

@rkirsling rkirsling left a comment

Choose a reason for hiding this comment

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

This SO explanation suggests that it's safe, so r=me.

@fujii fujii added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Jul 12, 2023
…to 'struct sockaddr_in *' increases required alignment from 2 to 4

https://bugs.webkit.org/show_bug.cgi?id=259096

Reviewed by Ross Kirsling.

clang-cl reported the following warning for Windows port.

> JavaScriptCore\inspector\remote\socket\win\RemoteInspectorSocketWin.cpp(172,33): warning: cast from 'struct sockaddr *' to 'struct sockaddr_in *' increases required alignment from 2 to 4 [-Wcast-align]
>             address.sin_addr = ((struct sockaddr_in*)(res->ai_addr))->sin_addr;
>                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* Source/JavaScriptCore/inspector/remote/socket/win/RemoteInspectorSocketWin.cpp:
(Inspector::Socket::connect): Use reinterpret_cast instead of C style cast to suppress the warning.

Canonical link: https://commits.webkit.org/265984@main
@webkit-commit-queue
Copy link
Collaborator

Committed 265984@main (f43f814): https://commits.webkit.org/265984@main

Reviewed commits have been landed. Closing PR #15728 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit f43f814 into WebKit:main Jul 12, 2023
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Jul 12, 2023
@fujii fujii deleted the eng/warning-sockaddr_in branch July 14, 2023 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues.
Projects
None yet
4 participants