Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -672,12 +672,9 @@ config("chromium_code") {
cflags = [
"-Wall",
"-Wextra",
"-Werror",
]

if (dart_sysroot != "alpine") {
cflags += [ "-Werror" ]
}

defines = []
if (!using_sanitizer && !is_clang) {
# _FORTIFY_SOURCE isn't really supported by Clang now, see
Expand Down
13 changes: 10 additions & 3 deletions runtime/bin/socket_base_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
#include "bin/socket_base_macos.h"
#include "platform/signal_blocker.h"

// We wrap CMSG_NXTHDR to suppress sign-compare warnings which occur on musl.
#define CMSG_NEXTHDR(mhdr, cmsg) \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wsign-compare\"") \
CMSG_NXTHDR(mhdr, cmsg) \
_Pragma("clang diagnostic pop")

namespace dart {
namespace bin {

Expand Down Expand Up @@ -151,13 +158,13 @@ intptr_t SocketBase::ReceiveMessage(intptr_t fd,
size_t num_messages = 0;
while (cmsg != nullptr) {
num_messages++;
cmsg = CMSG_NXTHDR(&msg, cmsg);
cmsg = CMSG_NEXTHDR(&msg, cmsg);
}
(*p_messages) = reinterpret_cast<SocketControlMessage*>(
Dart_ScopeAllocate(sizeof(SocketControlMessage) * num_messages));
SocketControlMessage* control_message = *p_messages;
for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != nullptr;
cmsg = CMSG_NXTHDR(&msg, cmsg), control_message++) {
cmsg = CMSG_NEXTHDR(&msg, cmsg), control_message++) {
void* data = CMSG_DATA(cmsg);
size_t data_length = cmsg->cmsg_len - (reinterpret_cast<uint8_t*>(data) -
reinterpret_cast<uint8_t*>(cmsg));
Expand Down Expand Up @@ -260,7 +267,7 @@ intptr_t SocketBase::SendMessage(intptr_t fd,
struct cmsghdr* cmsg = CMSG_FIRSTHDR(&msg);
message = messages;
for (intptr_t i = 0; i < num_messages;
i++, message++, cmsg = CMSG_NXTHDR(&msg, cmsg)) {
i++, message++, cmsg = CMSG_NEXTHDR(&msg, cmsg)) {
ASSERT(message->is_file_descriptors_control_message());
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_RIGHTS;
Expand Down