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

lwip/nsapi - Clean up warnings in network code #3162

Merged
merged 1 commit into from
Nov 1, 2016
Merged
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
7 changes: 6 additions & 1 deletion features/FEATURE_LWIP/lwip-interface/lwip-sys/arch/cc.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ typedef uintptr_t mem_ptr_t;
#define SZT_F "uz"

/* ARM/LPC17xx is little endian only */
#if !defined(BYTE_ORDER) || (BYTE_ORDER != LITTLE_ENDIAN && BYTE_ORDER != BIG_ENDIAN)
#ifdef BYTE_ORDER
#undef BYTE_ORDER
#endif
#define BYTE_ORDER LITTLE_ENDIAN
#endif

/* Use LWIP error codes */
#define LWIP_PROVIDE_ERRNO
Expand Down Expand Up @@ -92,7 +97,7 @@ typedef uintptr_t mem_ptr_t;
#define LWIP_CHKSUM_ALGORITHM 0

void* thumb2_memcpy(void* pDest, const void* pSource, size_t length);
u16_t thumb2_checksum(void* pData, int length);
u16_t thumb2_checksum(const void* pData, int length);
#else
/* Used with IP headers only */
#define LWIP_CHKSUM_ALGORITHM 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1179,6 +1179,7 @@ pbuf_coalesce(struct pbuf *p, pbuf_layer layer)
return p;
}
err = pbuf_copy(q, p);
LWIP_UNUSED_ARG(err);
LWIP_ASSERT("pbuf_copy failed", err == ERR_OK);
pbuf_free(p);
return q;
Expand Down
2 changes: 2 additions & 0 deletions features/netsocket/SocketAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ bool operator==(const SocketAddress &a, const SocketAddress &b)
} else if (a._addr.version == NSAPI_IPv6) {
return memcmp(a._addr.bytes, b._addr.bytes, NSAPI_IPv6_BYTES) == 0;
}

MBED_UNREACHABLE;
Copy link
Contributor

@c1728p9 c1728p9 Oct 28, 2016

Choose a reason for hiding this comment

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

Why not return false here? You could assert in addition if you want to trap.

Copy link
Contributor Author

@geky geky Oct 28, 2016

Choose a reason for hiding this comment

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

Well, a valid program should never actually reach this state after the previous conditions. Although we should probably make MBED_UNREACHABLE assert in debug builds.

}

bool operator!=(const SocketAddress &a, const SocketAddress &b)
Expand Down