diff --git a/src/api/api_msg.c b/src/api/api_msg.c
index b06f5f2f..69bec3d3 100644
--- a/src/api/api_msg.c
+++ b/src/api/api_msg.c
@@ -106,9 +106,9 @@ lwip_netconn_is_deallocated_msg(void *msg)
 #endif /* LWIP_NETCONN_FULLDUPLEX */
 
 #if LWIP_TCP
-const u8_t netconn_aborted = 0;
-const u8_t netconn_reset = 0;
-const u8_t netconn_closed = 0;
+static const u8_t netconn_aborted = 0;
+static const u8_t netconn_reset = 0;
+static const u8_t netconn_closed = 0;
 
 /** Translate an error to a unique void* passed via an mbox */
 static void *
diff --git a/src/api/sockets.c b/src/api/sockets.c
index 8d5d1311..929cd652 100644
--- a/src/api/sockets.c
+++ b/src/api/sockets.c
@@ -2115,7 +2115,7 @@ lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset,
           set_errno(EBADF);
         } else if (!nready) {
           /* Still none ready, just wait to be woken */
-          if (timeout == 0) {
+          if (timeout == NULL) {
             /* Wait forever */
             msectimeout = 0;
           } else {
diff --git a/src/apps/http/makefsdata/makefsdata.c b/src/apps/http/makefsdata/makefsdata.c
index 707d06f4..240c72e4 100644
--- a/src/apps/http/makefsdata/makefsdata.c
+++ b/src/apps/http/makefsdata/makefsdata.c
@@ -108,8 +108,8 @@ static int deflate_level; /* default compression level, can be changed via comma
 #include "../core/def.c"
 
 /** (Your server name here) */
-const char *serverID = "Server: "HTTPD_SERVER_AGENT"\r\n";
-char serverIDBuffer[1024];
+static const char *serverID = "Server: "HTTPD_SERVER_AGENT"\r\n";
+static char serverIDBuffer[1024];
 
 /* change this to suit your MEM_ALIGNMENT */
 #define PAYLOAD_ALIGNMENT 4
@@ -144,26 +144,26 @@ static int file_can_be_compressed(const char* filename);
 /* 5 bytes per char + 3 bytes per line */
 static char file_buffer_c[COPY_BUFSIZE * 5 + ((COPY_BUFSIZE / HEX_BYTES_PER_LINE) * 3)];
 
-char curSubdir[MAX_PATH_LEN-3];
-char lastFileVar[MAX_PATH_LEN];
-char hdr_buf[4096];
+static char curSubdir[MAX_PATH_LEN-3];
+static char lastFileVar[MAX_PATH_LEN];
+static char hdr_buf[4096];
 
-unsigned char processSubs = 1;
-unsigned char includeHttpHeader = 1;
-unsigned char useHttp11 = 0;
-unsigned char supportSsi = 1;
-unsigned char precalcChksum = 0;
-unsigned char includeLastModified = 0;
+static unsigned char processSubs = 1;
+static unsigned char includeHttpHeader = 1;
+static unsigned char useHttp11 = 0;
+static unsigned char supportSsi = 1;
+static unsigned char precalcChksum = 0;
+static unsigned char includeLastModified = 0;
 #if MAKEFS_SUPPORT_DEFLATE
-unsigned char deflateNonSsiFiles = 0;
-size_t deflatedBytesReduced = 0;
-size_t overallDataBytes = 0;
+static unsigned char deflateNonSsiFiles = 0;
+static size_t deflatedBytesReduced = 0;
+static size_t overallDataBytes = 0;
 #endif
-const char *exclude_list = NULL;
-const char *ncompress_list = NULL;
+static const char *exclude_list = NULL;
+static const char *ncompress_list = NULL;
 
-struct file_entry *first_file = NULL;
-struct file_entry *last_file = NULL;
+static struct file_entry *first_file = NULL;
+static struct file_entry *last_file = NULL;
 
 static char *ssi_file_buffer;
 static char **ssi_file_lines;
diff --git a/src/core/dns.c b/src/core/dns.c
index f83ea9b4..e84bab24 100644
--- a/src/core/dns.c
+++ b/src/core/dns.c
@@ -1421,7 +1421,7 @@ dns_enqueue(const char *name, size_t hostnamelen, dns_found_callback found,
 #endif /* LWIP_IPV4 && LWIP_IPV6 */
       /* this is a duplicate entry, find a free request entry */
       for (r = 0; r < DNS_MAX_REQUESTS; r++) {
-        if (dns_requests[r].found == 0) {
+        if (dns_requests[r].found == NULL) {
           dns_requests[r].found = found;
           dns_requests[r].arg = callback_arg;
           dns_requests[r].dns_table_idx = i;
diff --git a/src/core/ipv4/dhcp.c b/src/core/ipv4/dhcp.c
index 4b3c479d..ba3ef355 100644
--- a/src/core/ipv4/dhcp.c
+++ b/src/core/ipv4/dhcp.c
@@ -160,11 +160,11 @@ enum dhcp_option_idx {
 
 /** Holds the decoded option values, only valid while in dhcp_recv.
     @todo: move this into struct dhcp? */
-u32_t dhcp_rx_options_val[DHCP_OPTION_IDX_MAX];
+static u32_t dhcp_rx_options_val[DHCP_OPTION_IDX_MAX];
 /** Holds a flag which option was received and is contained in dhcp_rx_options_val,
     only valid while in dhcp_recv.
     @todo: move this into struct dhcp? */
-u8_t  dhcp_rx_options_given[DHCP_OPTION_IDX_MAX];
+static u8_t  dhcp_rx_options_given[DHCP_OPTION_IDX_MAX];
 
 static u8_t dhcp_discover_request_options[] = {
   DHCP_OPTION_SUBNET_MASK,
diff --git a/src/core/ipv4/etharp.c b/src/core/ipv4/etharp.c
index 2717cf7f..3092dc94 100644
--- a/src/core/ipv4/etharp.c
+++ b/src/core/ipv4/etharp.c
@@ -1015,7 +1015,7 @@ etharp_query(struct netif *netif, const ip4_addr_t *ipaddr, struct pbuf *q)
      * new PBUF_RAM. See the definition of PBUF_NEEDS_COPY for details. */
     p = q;
     while (p) {
-      LWIP_ASSERT("no packet queues allowed!", (p->len != p->tot_len) || (p->next == 0));
+      LWIP_ASSERT("no packet queues allowed!", (p->len != p->tot_len) || (p->next == NULL));
       if (PBUF_NEEDS_COPY(p)) {
         copy_needed = 1;
         break;
@@ -1039,7 +1039,7 @@ etharp_query(struct netif *netif, const ip4_addr_t *ipaddr, struct pbuf *q)
       new_entry = (struct etharp_q_entry *)memp_malloc(MEMP_ARP_QUEUE);
       if (new_entry != NULL) {
         unsigned int qlen = 0;
-        new_entry->next = 0;
+        new_entry->next = NULL;
         new_entry->p = p;
         if (arp_table[i].q != NULL) {
           /* queue was already existent, append the new entry to the end */
diff --git a/src/core/pbuf.c b/src/core/pbuf.c
index e6027261..4da1bd5c 100644
--- a/src/core/pbuf.c
+++ b/src/core/pbuf.c
@@ -680,7 +680,7 @@ pbuf_free_header(struct pbuf *q, u16_t size)
       struct pbuf *f = p;
       free_left = (u16_t)(free_left - p->len);
       p = p->next;
-      f->next = 0;
+      f->next = NULL;
       pbuf_free(f);
     } else {
       pbuf_remove_header(p, free_left);
diff --git a/src/core/tcp.c b/src/core/tcp.c
index 5b4f4e5e..24b21be7 100644
--- a/src/core/tcp.c
+++ b/src/core/tcp.c
@@ -275,8 +275,9 @@ tcp_listen_closed(struct tcp_pcb *pcb)
   for (i = 1; i < LWIP_ARRAYSIZE(tcp_pcb_lists); i++) {
     tcp_remove_listener(*tcp_pcb_lists[i], (struct tcp_pcb_listen *)pcb);
   }
-#endif
+#else
   LWIP_UNUSED_ARG(pcb);
+#endif
 }
 
 #if TCP_LISTEN_BACKLOG
diff --git a/src/include/lwip/pbuf.h b/src/include/lwip/pbuf.h
index 5a4fc88b..964aa2ae 100644
--- a/src/include/lwip/pbuf.h
+++ b/src/include/lwip/pbuf.h
@@ -254,8 +254,8 @@ struct pbuf_custom {
 #ifndef PBUF_POOL_FREE_OOSEQ
 #define PBUF_POOL_FREE_OOSEQ 1
 #endif /* PBUF_POOL_FREE_OOSEQ */
-#if LWIP_TCP && TCP_QUEUE_OOSEQ && NO_SYS && PBUF_POOL_FREE_OOSEQ
 extern volatile u8_t pbuf_free_ooseq_pending;
+#if LWIP_TCP && TCP_QUEUE_OOSEQ && NO_SYS && PBUF_POOL_FREE_OOSEQ
 void pbuf_free_ooseq(void);
 /** When not using sys_check_timeouts(), call PBUF_CHECK_FREE_OOSEQ()
     at regular intervals from main level to check if ooseq pbufs need to be
diff --git a/src/netif/bridgeif.c b/src/netif/bridgeif.c
index 8a97bce3..021922f6 100644
--- a/src/netif/bridgeif.c
+++ b/src/netif/bridgeif.c
@@ -120,7 +120,7 @@ typedef struct bridgeif_private_s {
 } bridgeif_private_t;
 
 /* netif data index to get the bridge on input */
-u8_t bridgeif_netif_client_id = 0xff;
+static u8_t bridgeif_netif_client_id = 0xff;
 
 /**
  * @ingroup bridgeif
