Closed ilovezfs closed 6 years ago
Isn't using -Werror
for release builds considered a bit naughty?
Otherwise you can end up in the situation that a newer release of compiler adds extra warnings to -Wall
which has the knock on effect of breaking the build. Which I believe is what has happened here.
@ilovezfs if you remove the -Werror
from here it should get you building again, but the underlying issue still needs resolving:
https://github.com/monome/serialosc/blob/2aba0b73d45c0e5094a8e0eff3c7c5a8f08fc8ff/wscript#L231
@samdoshi yes, I've already done that in https://github.com/Homebrew/homebrew-core/pull/17190 :) Nonetheless it should be fixed.
The issue here is that clang is absolutely right and this is a bug in the code – removing -Werror
in this situation is the wrong thing to do and could potentially be dangerous. According to LLVM bug 22821, dereferencing an unaligned pointer this way "results in crashing programs on ARM, SPARC, and maybe other architectures".
We're probably okay here since the smallest thing in the relevant struct sosc_ipc_msg
is a uint16_t
(which actually will probably be aligned anyway), but to be on the safe side I'm going to remove the PACKED
attributes and make sure everything's still kosher.
I would prefer you not remove -Werror
because it means that actual issues like this bubble up to being more informative than "serialosc crashes randomly" (which has been happening on Linux and I have no idea why).
I'll look in this on the weekend. Thanks for reporting.
@wrl thanks!
I would prefer you not remove -Werror because …
The change in https://github.com/Homebrew/homebrew-core/pull/17190 is just
+ if DevelopmentTools.clang_build_version >= 802
+ inreplace "wscript", '"-Werror"',
+ '"-Werror", "-Wno-address-of-packed-member"'
+ end
Thanks for reporting.
You're welcome :)
Thanks @artfwo!
This causes the build to fail on macOS Sierra and above with >= Xcode 8.3. It will also fail with any version of LLVM 4's clang regardless of platform.
CC @wrl