build BUGFIX when both SSH and TLS are off
diff --git a/src/io.c b/src/io.c
index 3653b6c..432ec70 100644
--- a/src/io.c
+++ b/src/io.c
@@ -25,6 +25,7 @@
 #include <assert.h>
 #include <errno.h>
 #include <poll.h>
+#include <inttypes.h>
 #include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/src/session.c b/src/session.c
index 387cf5c..7a31ea0 100644
--- a/src/session.c
+++ b/src/session.c
@@ -22,6 +22,7 @@
 
 #include <errno.h>
 #include <stdlib.h>
+#include <string.h>
 #include <pthread.h>
 #include <time.h>
 #include <libyang/libyang.h>
@@ -234,7 +235,6 @@
     int connected; /* flag to indicate whether the transport socket is still connected */
     int multisession = 0; /* flag for more NETCONF sessions on a single SSH session */
     pthread_t tid;
-    struct nc_session *siter;
     struct nc_msg_cont *contiter;
     struct lyxml_elem *rpl, *child;
     struct lyd_node *close_rpc;
@@ -336,10 +336,14 @@
          * so it is up to the caller to close them correctly
          * TODO use callbacks
          */
+        /* just to avoid compiler warning */
+        (void)connected;
         break;
 
 #ifdef ENABLE_SSH
     case NC_TI_LIBSSH:
+        struct nc_session *siter;
+
         if (connected) {
             ssh_channel_free(session->ti.libssh.channel);
         }
diff --git a/src/session_server.c b/src/session_server.c
index 593460e..00f80f5 100644
--- a/src/session_server.c
+++ b/src/session_server.c
@@ -631,7 +631,7 @@
 nc_ps_poll(struct nc_pollsession *ps, int timeout)
 {
     int ret;
-    uint16_t i, j;
+    uint16_t i;
     time_t cur_time;
     NC_MSG_TYPE msgtype;
     struct nc_session *session;
@@ -669,7 +669,9 @@
     }
 
     if (i == ps->session_count) {
+#ifdef ENABLE_SSH
 retry_poll:
+#endif
         /* no leftover event */
         i = 0;
         ret = poll(ps->pfds, ps->session_count, timeout);
@@ -693,6 +695,8 @@
         } else if (ps->pfds[i].revents & POLLIN) {
 #ifdef ENABLE_SSH
             if (ps->sessions[i]->ti_type == NC_TI_LIBSSH) {
+                uint16_t j;
+
                 /* things are not that simple with SSH... */
                 ret = nc_ssh_pollin(ps->sessions[i], &timeout);