diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt
index feee27bce79619853328c6b3d45457632e9936c5..51d779fa59a471724afbd756c20eeb526e9ecf4c 100644
--- a/cmake_targets/CMakeLists.txt
+++ b/cmake_targets/CMakeLists.txt
@@ -132,16 +132,19 @@ Message("Architecture is ${CMAKE_SYSTEM_PROCESSOR}")
 if (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
   set(C_FLAGS_PROCESSOR "-gdwarf-2 -mfloat-abi=hard -mfpu=neon -lgcc -lrt")
 else (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
-  file(STRINGS "/proc/cpuinfo" CPUINFO REGEX flags LIMIT_COUNT 1)
-  #Message("CPUINFO is ${CPUINFO}")
-  if (CPUINFO MATCHES "avx2")
-    set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx2")
-  endif()
-  if (CPUINFO MATCHES "sse4_1")
-    set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1")
-  endif()
-  if (CPUINFO MATCHES "ssse3")
-    set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mssse3")
+  if(EXISTS  "/proc/cpuinfo")
+    file(STRINGS "/proc/cpuinfo" CPUINFO REGEX flags LIMIT_COUNT 1)
+    if (CPUINFO MATCHES "avx2")
+      set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx2")
+    endif()
+    if (CPUINFO MATCHES "sse4_1")
+      set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1")
+    endif()
+    if (CPUINFO MATCHES "ssse3")
+      set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mssse3")
+    endif()
+  else()
+    Message("/proc/cpuinfo does not exit. We will use manual CPU flags")
   endif()
 endif()
 
@@ -151,7 +154,7 @@ Message("C_FLAGS_PROCESSOR is ${C_FLAGS_PROCESSOR}")
 
 if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86")
   if ( (NOT( C_FLAGS_PROCESSOR MATCHES "ssse3")) OR (NOT( C_FLAGS_PROCESSOR MATCHES "msse4.1")) )
-    Message(FATAL_ERROR "For x86 Architecture, you must have following flags: -mssse3 -msse4.1. The current detected flags are: ${C_FLAGS_PROCESSOR}. You can pass the flags manually in build script, for example: ./build_oai --cflags_processor \"-mssse3 -msse4.1\" ")
+    Message(FATAL_ERROR "For x86 Architecture, you must have following flags: -mssse3 -msse4.1. The current detected flags are: ${C_FLAGS_PROCESSOR}. You can pass the flags manually in build script, for example: ./build_oai --cflags_processor \"-mssse3 -msse4.1 -mavx2\" ")
   endif()
 endif()
 
diff --git a/cmake_targets/tools/fix_asn1 b/cmake_targets/tools/fix_asn1
index dcc00d5e37240853d81231ad7e451fe6c249838f..0661d7878de20d86741df8e222875f3e7c79ab38 100755
--- a/cmake_targets/tools/fix_asn1
+++ b/cmake_targets/tools/fix_asn1
@@ -9,13 +9,13 @@ RRC_Rel10=(
 
 X2AP_Rel11_2=(
   "X2ap-CriticalityDiagnostics-IE-List.h" ae96308b37fcbcbf39da5012e42968135fc5f27b "fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h.diff"
-  "NativeInteger.c"                       9f173e87daa1e7378618dbb060a10aae752d74be "fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff"
-  "constr_SET_OF.c"                       5c8765a1e0fc44a48e406d0aa7628004bf3aac2a "fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c.diff"
+  "NativeInteger.c"                       1a55f5402fd363318cf5444ffe1f67530dcf66ff "fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff"
+  "constr_SET_OF.c"                       808cbbdf19b118c0bdb04e3acf2cbe6e4133be2b "fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c.diff"
 )
 
 S1AP_Rel10_5=(
-  "NativeInteger.c" 9f173e87daa1e7378618dbb060a10aae752d74be "fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff"
-  "constr_SET_OF.c" 5c8765a1e0fc44a48e406d0aa7628004bf3aac2a "fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c.diff"
+  "NativeInteger.c" 1a55f5402fd363318cf5444ffe1f67530dcf66ff "fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff"
+  "constr_SET_OF.c" 808cbbdf19b118c0bdb04e3acf2cbe6e4133be2b "fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c.diff"
 )
 
 red_color="$(tput setaf 1)"
diff --git a/common/utils/collection/hashtable/hashtable.c b/common/utils/collection/hashtable/hashtable.c
index d424e2a0add6bbb31962b7f47d68b50359d751f9..4ce0ee7a7ed7ca3d2b830a0d50857e6578123295 100755
--- a/common/utils/collection/hashtable/hashtable.c
+++ b/common/utils/collection/hashtable/hashtable.c
@@ -177,7 +177,6 @@ hashtable_rc_t hashtable_dump_content (const hash_table_t * const hashtblP, char
 {
     hash_node_t  *node         = NULL;
     unsigned int  i            = 0;
-    unsigned int  num_elements = 0;
     if (hashtblP == NULL) {
         *remaining_bytes_in_buffer_pP = snprintf(
                 buffer_pP,
diff --git a/common/utils/itti/memory_pools.c b/common/utils/itti/memory_pools.c
index dadc80ca2af76268bf170f11967f9f707e795d77..97ec7d8e3886823b5458db6ccaff071400c68777 100644
--- a/common/utils/itti/memory_pools.c
+++ b/common/utils/itti/memory_pools.c
@@ -54,7 +54,9 @@ uint64_t vcd_mp_free;
 #endif
 
 /*------------------------------------------------------------------------------*/
+#ifndef CHARS_TO_UINT32
 #define CHARS_TO_UINT32(c1, c2, c3, c4) (((c1) << 24) | ((c2) << 16) | ((c3) << 8) | (c4))
+#endif
 
 #define MEMORY_POOL_ITEM_INFO_NUMBER    2
 
diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c
index c819704bd20bc3eb0d90a82427b107c4cfb8203c..1f98a0eecca0fcf498083de909d74d6cdf8957e9 100644
--- a/openair1/PHY/INIT/lte_init.c
+++ b/openair1/PHY/INIT/lte_init.c
@@ -128,8 +128,8 @@ void phy_config_sib2_eNB(uint8_t Mod_id,
 {
 
   LTE_DL_FRAME_PARMS *lte_frame_parms = &PHY_vars_eNB_g[Mod_id][CC_id]->lte_frame_parms;
-  LTE_eNB_UE_stats *eNB_UE_stats      = PHY_vars_eNB_g[Mod_id][CC_id]->eNB_UE_stats;
-  int32_t rx_total_gain_eNB_dB        = PHY_vars_eNB_g[Mod_id][CC_id]->rx_total_gain_eNB_dB;
+  //LTE_eNB_UE_stats *eNB_UE_stats      = PHY_vars_eNB_g[Mod_id][CC_id]->eNB_UE_stats;
+  //int32_t rx_total_gain_eNB_dB        = PHY_vars_eNB_g[Mod_id][CC_id]->rx_total_gain_eNB_dB;
   int i;
 
   LOG_D(PHY,"[eNB%d] CCid %d Frame %d: Applying radioResourceConfigCommon\n",Mod_id,CC_id,PHY_vars_eNB_g[Mod_id][CC_id]->proc[8].frame_tx);
@@ -683,11 +683,11 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
                                     int CC_id)
 {
 
-  PHY_VARS_eNB *phy_vars_eNB = PHY_vars_eNB_g[Mod_id][CC_id];
+  //PHY_VARS_eNB *phy_vars_eNB = PHY_vars_eNB_g[Mod_id][CC_id];
   uint8_t UE_id = find_ue(rnti,PHY_vars_eNB_g[Mod_id][0]);
   struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10 = sCellToAddMod_r10->radioResourceConfigDedicatedSCell_r10->physicalConfigDedicatedSCell_r10;
   //struct RadioResourceConfigCommonSCell_r10 *physicalConfigCommonSCell_r10 = sCellToAddMod_r10->radioResourceConfigCommonSCell_r10;
-  PhysCellId_t physCellId_r10 = sCellToAddMod_r10->cellIdentification_r10->physCellId_r10;
+  //PhysCellId_t physCellId_r10 = sCellToAddMod_r10->cellIdentification_r10->physCellId_r10;
   ARFCN_ValueEUTRA_t dl_CarrierFreq_r10 = sCellToAddMod_r10->cellIdentification_r10->dl_CarrierFreq_r10;
   uint32_t carrier_freq_local;
 
@@ -733,7 +733,7 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
   }
 
   if (physicalConfigDedicatedSCell_r10) {
-#warning " phy_vars_eNB->physicalConfigDedicatedSCell_r10 does not exist in phy_vars_eNB"
+//#warning " phy_vars_eNB->physicalConfigDedicatedSCell_r10 does not exist in phy_vars_eNB"
     //  phy_vars_eNB->physicalConfigDedicatedSCell_r10[UE_id] = physicalConfigDedicatedSCell_r10;
     LOG_I(PHY,"[eNB %d] Frame %d: Configured phyConfigDedicatedSCell with CC_id %d for UE %d\n",Mod_id,/*phy_vars_eNB->frame*/0,CC_id,UE_id);
   } else {
diff --git a/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c
index 14e1c185711d119715c186b0328a36ab476b4297..d5bfee81edc127c124aef25eead5cacc68812738 100644
--- a/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c
+++ b/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c
@@ -48,15 +48,15 @@ void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB,
   LTE_eNB_COMMON *eNB_common_vars = &phy_vars_eNB->lte_eNB_common_vars;
   LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms;
   PHY_MEASUREMENTS_eNB *phy_measurements = &phy_vars_eNB->PHY_measurements_eNB[eNB_id];
-  int32_t *rb_mask = phy_vars_eNB->rb_mask_ul;
+  uint32_t *rb_mask = phy_vars_eNB->rb_mask_ul;
 
-  uint32_t aarx,rx_power_correction;
+  uint32_t aarx /* ,rx_power_correction */;
   uint32_t rb;
   int32_t *ul_ch;
   int32_t n0_power_tot;
   int len;
   int offset;
-  int Nsymb = (frame_parms->Ncp==NORMAL)?14:12;
+  //int Nsymb = (frame_parms->Ncp==NORMAL)?14:12;
   // noise measurements
   // for the moment we measure the noise on the 7th OFDM symbol (in S subframe)
 
diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c
index 65c4214427d5be4574db5d1ff86a0a993d6e156f..3bc26ad7e85b88bf57029c8dfcd9de11f3dc9bfc 100644
--- a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c
+++ b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c
@@ -572,7 +572,7 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
         // skip the first 4 RE due to interpolation filter length of 5 (not possible to skip 5 due to 128i alignment, must be multiple of 128bit)
 
 #if defined(__x86_64__) || defined(__i386__)
-       __m128i pmi128_re,pmi128_im,mmtmpPMI0,mmtmpPMI1,mmtmpPMI2,mmtmpPMI3;
+       __m128i pmi128_re,pmi128_im,mmtmpPMI0,mmtmpPMI1 /* ,mmtmpPMI2,mmtmpPMI3 */ ;
 
         dl_ch0_128    = (__m128i *)&phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_id][aarx][4];
         dl_ch1_128    = (__m128i *)&phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_id][2+aarx][4];
diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
index 95af038ab0265ec9dd6832de6deb6950aacbffa0..bf422fc37a5748b45942726c6cc6ce904f96834e 100644
--- a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
+++ b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
@@ -44,6 +44,7 @@
 #include "PHY/CODING/extern.h"
 #include "PHY/CODING/lte_interleaver_inline.h"
 #include "PHY/LTE_TRANSPORT/defs.h"
+#include "SCHED/defs.h"
 #include "defs.h"
 #include "UTIL/LOG/vcd_signal_dumper.h"
 
diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h
index 578b05634cfc40b15b2629fb25f4d1d10629fbeb..3c16ce0cd3eaa18e3271eb18710d2548d6f254c3 100755
--- a/openair1/PHY/defs.h
+++ b/openair1/PHY/defs.h
@@ -65,10 +65,12 @@
 //use msg in the real-time thread context
 #define msg_nrt printf
 //use msg_nrt in the non real-time context (for initialization, ...)
-#ifdef __AVX2__
-#define malloc16(x) memalign(32,x)
-#else
-#define malloc16(x) memalign(16,x)
+#ifndef malloc16
+#  ifdef __AVX2__
+#    define malloc16(x) memalign(32,x)
+#  else
+#    define malloc16(x) memalign(16,x)
+#  endif
 #endif
 #define free16(y,x) free(y)
 #define bigmalloc malloc
diff --git a/openair1/SCHED/phy_mac_stub.c b/openair1/SCHED/phy_mac_stub.c
index 9bcba1072c300e8d71f9526c733c11c5ad466489..6e90960bfc2d2f12804c3d745deba8e95d260e6e 100644
--- a/openair1/SCHED/phy_mac_stub.c
+++ b/openair1/SCHED/phy_mac_stub.c
@@ -54,11 +54,11 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e
 {
 
   int i;
-  uint8_t cooperation_flag = phy_vars_eNB->cooperation_flag;
+  //uint8_t cooperation_flag = phy_vars_eNB->cooperation_flag;
   uint8_t transmission_mode = phy_vars_eNB->transmission_mode[0];
 
   uint32_t rballoc = 0x7FFF;
-  uint32_t rballoc2 = 0x000F;
+  //uint32_t rballoc2 = 0x000F;
   int subframe = phy_vars_eNB->proc[sched_subframe].subframe_tx;
 
   LTE_eNB_DLSCH_t *DLSCH_ptr = phy_vars_eNB->dlsch_eNB[0][0];
@@ -585,7 +585,7 @@ void fill_dci_emos(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *phy_vars_eN
 {
 
   int i;
-  uint8_t cooperation_flag = phy_vars_eNB->cooperation_flag;
+  //uint8_t cooperation_flag = phy_vars_eNB->cooperation_flag;
   uint8_t transmission_mode = phy_vars_eNB->transmission_mode[0];
 
   //uint32_t rballoc = 0x00F0;
diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c
index 375c0dcd1f165cf712e39e03e983c83da8a5fbc3..e8c9ac670b81c06d7a1fe57d945dfc672f560c87 100755
--- a/openair1/SCHED/phy_procedures_lte_eNb.c
+++ b/openair1/SCHED/phy_procedures_lte_eNb.c
@@ -612,6 +612,7 @@ void phy_eNB_lte_check_measurement_thresholds(instance_t instanceP, ral_threshol
 #endif
 
 
+unsigned int taus(void);
 
 void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag,
                            relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn)
@@ -1822,6 +1823,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
   stop_meas(&phy_vars_eNB->phy_proc_tx);
 
 
+  (void)re_allocated; /* remove gcc warning "set but not used" */
 }
 
 void process_Msg3(PHY_VARS_eNB *phy_vars_eNB,uint8_t sched_subframe,uint8_t UE_id, uint8_t harq_pid)
@@ -2493,6 +2495,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
   }
 
   sect_id = 0;
+  (void)sect_id; /* remove gcc warning "set but not used" */
 
   /*
     for (UE_id=0;UE_id<NUMBER_OF_UE_MAX;UE_id++) {
@@ -3604,6 +3607,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
 
   } // loop i=0 ... NUMBER_OF_UE_MAX-1
 
+  (void)pusch_active; /* remove gcc warning "set but not used" */
   //  if (pusch_active == 0) {
     if (abstraction_flag == 0) {
       //      LOG_D(PHY,"[eNB] Frame %d, subframe %d Doing I0_measurements\n",
diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c
index b29c229f27aa0a277c1021830a2d33228dc78c07..e7b4980ac3d825ecfb1627f7aab728fdd775ac77 100755
--- a/openair1/SCHED/phy_procedures_lte_ue.c
+++ b/openair1/SCHED/phy_procedures_lte_ue.c
@@ -902,6 +902,8 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
           }
           */
 
+          unsigned int taus(void);
+
           for (i=0; i<input_buffer_length; i++)
             ulsch_input_buffer[i]= (uint8_t)(taus()&0xff);
 
diff --git a/openair1/SCHED/pucch_pc.c b/openair1/SCHED/pucch_pc.c
index feeff7159886cec6f01ce65fa45f20f1bf181009..afcf4bd5b34ea2604359d9e1b5bee46d95ace50f 100644
--- a/openair1/SCHED/pucch_pc.c
+++ b/openair1/SCHED/pucch_pc.c
@@ -46,16 +46,16 @@ int8_t pucch_power_cntl(PHY_VARS_UE *phy_vars_ue,uint8_t subframe,uint8_t eNB_id
 {
 
   int8_t Po_PUCCH;
-  uint8_t harq_pid;
+  //uint8_t harq_pid;
 
   // P_pucch =  P_opucch+ PL + h(nCQI,nHARQ) + delta_pucchF(pucch_fmt) + g(i))
   //
-  if ((pucch_fmt == pucch_format1a) ||
-      (pucch_fmt == pucch_format1b)) {  // Update g_pucch based on TPC/delta_PUCCH received in PDCCH for this process
-    harq_pid = phy_vars_ue->dlsch_ue[eNB_id][0]->harq_ack[subframe].harq_id;
+  //if ((pucch_fmt == pucch_format1a) ||
+  //    (pucch_fmt == pucch_format1b)) {  // Update g_pucch based on TPC/delta_PUCCH received in PDCCH for this process
+    //harq_pid = phy_vars_ue->dlsch_ue[eNB_id][0]->harq_ack[subframe].harq_id;
     //this is now done in dci_tools
     //phy_vars_ue->g_pucch[eNB_id] += phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->delta_PUCCH;
-  }
+  //}
 
   Po_PUCCH = get_PL(phy_vars_ue->Mod_id,phy_vars_ue->CC_id,eNB_id)+
     phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH+
diff --git a/openair1/SCHED/pusch_pc.c b/openair1/SCHED/pusch_pc.c
index 2af8771afef6bc48bf61d306e8ef777fe1cd7860..5fb1f7449ca9a2bcf77554d6027b85f189e6a5c0 100644
--- a/openair1/SCHED/pusch_pc.c
+++ b/openair1/SCHED/pusch_pc.c
@@ -81,7 +81,7 @@ int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id,
   //(phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->control_only == 1) ? phy_vars_eNB->ulsch_eNB[UE_id]->beta_offset_cqi_times8:8;
 
   DevAssert( UE_id < NUMBER_OF_UE_MAX );
-#warning "This condition happens sometimes. Need more investigation" // navid
+//#warning "This condition happens sometimes. Need more investigation" // navid
   //DevAssert( MPR_x100/6 < 100 );
 
   if (phy_vars_eNB->ul_power_control_dedicated[UE_id].deltaMCS_Enabled == 1) {
diff --git a/openair1/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c b/openair1/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c
index 765952133a5c3b784ac5f4867d35029b315eff98..0ced6e0cebda82589cec66b07a2d986eb411d576 100644
--- a/openair1/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c
+++ b/openair1/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c
@@ -288,7 +288,7 @@ int emu_transport_handle_ue_info(bypass_msg_header_t *messg,
               n_ue, total_header+total_tbs,total_header,total_tbs);
       }
 
-#warning "CC id should be adjusted, set to zero for the moment"
+//#warning "CC id should be adjusted, set to zero for the moment"
       memcpy(&UE_transport_info[n_ue][CC_id], UE_info, total_header + total_tbs);
 
       /* Go to the next UE info */
diff --git a/openair1/SIMULATION/ETH_TRANSPORT/emu_transport.c b/openair1/SIMULATION/ETH_TRANSPORT/emu_transport.c
index 8c5516eabd6837e9860efafb93f6edf8c7d5ccb3..ec15e7c668924ad000f544bd32345f01f93bb8eb 100644
--- a/openair1/SIMULATION/ETH_TRANSPORT/emu_transport.c
+++ b/openair1/SIMULATION/ETH_TRANSPORT/emu_transport.c
@@ -291,7 +291,6 @@ void fill_phy_enb_vars(unsigned int enb_id, uint8_t CC_id,unsigned int next_slot
   LTE_eNB_DLSCH_t *dlsch_eNB;
   unsigned short ue_id;
   uint8_t nb_total_dci;
-  int i;
 
   // eNB
   // PBCH : copy payload
diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c
index d67024810a6672107e7e4a3f7b6ddd76cf631dc1..6f2c1f1d224494c93e78de898fc9792098a6951a 100644
--- a/openair1/SIMULATION/LTE_PHY/dlsim.c
+++ b/openair1/SIMULATION/LTE_PHY/dlsim.c
@@ -220,7 +220,7 @@ int main(int argc, char **argv)
   uint8_t N_RB_DL=25,osf=1;
   frame_t frame_type = FDD;
   int xforms=0;
-  FD_lte_phy_scope_ue *form_ue;
+  FD_lte_phy_scope_ue *form_ue = NULL;
   char title[255];
   uint32_t DLSCH_RB_ALLOC = 0x1fff;
   int numCCE=0;
@@ -2624,6 +2624,8 @@ PMI_FEEDBACK:
                                               num_pdcch_symbols,
                                               PHY_vars_eNB->dlsch_eNB[k][0],
                                               PHY_vars_eNB->dlsch_eNB[k][1]);	      
+              /* avoid gcc warnings */
+              (void)re_allocated;
 
               stop_meas(&PHY_vars_eNB->dlsch_modulation_stats);
               /*
diff --git a/openair1/SIMULATION/LTE_PHY/mbmssim.c b/openair1/SIMULATION/LTE_PHY/mbmssim.c
index 0044b2ff5155bdbedb02c9eaaedb2ae035b21f28..8522b7be9a80693df3c8f2eb78c9ad6b7a42deaa 100644
--- a/openair1/SIMULATION/LTE_PHY/mbmssim.c
+++ b/openair1/SIMULATION/LTE_PHY/mbmssim.c
@@ -583,10 +583,10 @@ int main(int argc, char **argv)
               mcs,N_RB_DL,mcs,N_RB_DL,errs[0],
               mcs,N_RB_DL,mcs,N_RB_DL,trials);
     else
-      fprintf(fd,"SNR_awgn_%d = [SNR_awgn_%d %d]; errs_mch_awgn_%d =[errs_mch_awgn_%f  %d]; mch_trials_awgn_%d =[mch_trials_awgn_%d %d];\n",
-              mcs,N_RB_DL,mcs,N_RB_DL,SNR,
-              mcs,N_RB_DL,mcs,N_RB_DL,errs[0],
-              mcs,N_RB_DL,mcs,N_RB_DL,trials);
+      fprintf(fd,"SNR_awgn_%d = [SNR_awgn_%d %f]; errs_mch_awgn_%d =[errs_mch_awgn_%d  %d]; mch_trials_awgn_%d =[mch_trials_awgn_%d %d];\n",
+              N_RB_DL,N_RB_DL,SNR,
+              N_RB_DL,N_RB_DL,errs[0],
+              N_RB_DL,N_RB_DL,trials);
 
     fflush(fd);
 
diff --git a/openair1/SIMULATION/LTE_PHY/pbchsim.c b/openair1/SIMULATION/LTE_PHY/pbchsim.c
index 319c2ed008511124f84423aba9dac231cbc867b4..739c7e121fa41e1baf3ee78c034aa1d29e7c0d37 100644
--- a/openair1/SIMULATION/LTE_PHY/pbchsim.c
+++ b/openair1/SIMULATION/LTE_PHY/pbchsim.c
@@ -80,9 +80,9 @@ int main(int argc, char **argv)
   unsigned char pbch_pdu[6];
   //  int sync_pos, sync_pos_slot;
   //  FILE *rx_frame_file;
-  FILE *output_fd;
+  FILE *output_fd = NULL;
   uint8_t write_output_file=0;
-  int result;
+  //int result;
   int freq_offset;
   //  int subframe_offset;
   //  char fname[40], vname[40];
@@ -91,8 +91,8 @@ int main(int argc, char **argv)
   uint16_t Nid_cell=0;
 
   int n_frames=1;
-  channel_desc_t *eNB2UE,*eNB2UE1,*eNB2UE2;
-  uint32_t nsymb,tx_lev,tx_lev1,tx_lev2;
+  channel_desc_t *eNB2UE,*eNB2UE1 = NULL,*eNB2UE2 = NULL;
+  uint32_t nsymb,tx_lev,tx_lev1 = 0,tx_lev2 = 0;
   uint8_t extended_prefix_flag=0;
   int8_t interf1=-21,interf2=-21;
   LTE_DL_FRAME_PARMS *frame_parms;
@@ -104,12 +104,12 @@ int main(int argc, char **argv)
   char input_val_str[50],input_val_str2[50];
   //  double input_val1,input_val2;
   //  uint16_t amask=0;
-  uint8_t frame_mod4,num_pdcch_symbols;
+  uint8_t frame_mod4,num_pdcch_symbols = 0;
   uint16_t NB_RB=25;
 
   SCM_t channel_model=AWGN;//Rayleigh1_anticorr;
 
-  DCI_ALLOC_t dci_alloc[8];
+  //DCI_ALLOC_t dci_alloc[8];
   uint8_t abstraction_flag=0;//,calibration_flag=0;
   double pbch_sinr;
   int pbch_tx_ant;
@@ -782,7 +782,10 @@ int main(int argc, char **argv)
     i=0;
 
     while (!feof(input_fd)) {
-      fscanf(input_fd,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2);
+      if (fscanf(input_fd,"%s %s",input_val_str,input_val_str2) != 2) { //&input_val1,&input_val2);
+        printf("%s:%d:%s: error with fscanf, exiting\n", __FILE__, __LINE__, __FUNCTION__);
+        exit(1);
+      }
 
       if ((i%4)==0) {
         ((short*)txdata[0])[i/2] = (short)((1<<15)*strtod(input_val_str,NULL));
diff --git a/openair1/SIMULATION/LTE_PHY/pdcchsim.c b/openair1/SIMULATION/LTE_PHY/pdcchsim.c
index 3c717d2625bfea663c9d5df88bbf1927388f47c5..0c51959f148371209f8fc42f3c28d55af05dd49a 100644
--- a/openair1/SIMULATION/LTE_PHY/pdcchsim.c
+++ b/openair1/SIMULATION/LTE_PHY/pdcchsim.c
@@ -67,9 +67,9 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2
   uint32_t UL_alloc_pdu[2];
 
   int i;
-  int dci_length_bytes,dci_length;
-  int BCCH_pdu_size_bits, BCCH_pdu_size_bytes;
-  int UL_pdu_size_bits, UL_pdu_size_bytes;
+  int dci_length_bytes=0,dci_length=0;
+  int BCCH_pdu_size_bits=0, BCCH_pdu_size_bytes=0;
+  int UL_pdu_size_bits=0, UL_pdu_size_bytes=0;
   int mcs = 3;
 
   DCI_pdu.Num_ue_spec_dci = 0;
@@ -789,6 +789,11 @@ int main(int argc, char **argv)
     while (!feof(input_fd)) {
       ret=fscanf(input_fd,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2);
 
+      if (ret != 2) {
+        printf("%s:%d:%s: fscanf error, exiting\n", __FILE__, __LINE__, __FUNCTION__);
+        exit(1);
+      }
+
       if ((i%4)==0) {
         ((short*)txdata[0])[i/2] = (short)((1<<15)*strtod(input_val_str,NULL));
         ((short*)txdata[0])[(i/2)+1] = (short)((1<<15)*strtod(input_val_str2,NULL));
diff --git a/openair1/SIMULATION/LTE_PHY/prachsim.c b/openair1/SIMULATION/LTE_PHY/prachsim.c
index 187a521e07307e0f871bbd1f77be27eeaa88c991..0fab08a3d1234f15bdfaa1eff184aac9c47843b9 100644
--- a/openair1/SIMULATION/LTE_PHY/prachsim.c
+++ b/openair1/SIMULATION/LTE_PHY/prachsim.c
@@ -58,6 +58,8 @@ PHY_VARS_UE *PHY_vars_UE;
 
 extern uint16_t prach_root_sequence_map0_3[838];
 
+void dump_prach_config(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
+
 int main(int argc, char **argv)
 {
 
@@ -74,7 +76,7 @@ int main(int argc, char **argv)
   int **txdata;
   double **s_re,**s_im,**r_re,**r_im;
   double iqim=0.0;
-  int trial, ntrials=1;
+  int trial; //, ntrials=1;
   uint8_t transmission_mode = 1,n_tx=1,n_rx=1;
   uint16_t Nid_cell=0;
 
@@ -82,7 +84,7 @@ int main(int argc, char **argv)
   uint8_t hs_flag=0;
   int n_frames=1;
   channel_desc_t *UE2eNB;
-  uint32_t nsymb,tx_lev,tx_lev_dB;
+  uint32_t nsymb,tx_lev; //,tx_lev_dB;
   uint8_t extended_prefix_flag=0;
   //  int8_t interf1=-19,interf2=-19;
   LTE_DL_FRAME_PARMS *frame_parms;
@@ -101,8 +103,8 @@ int main(int argc, char **argv)
   uint16_t preamble_energy_list[64],preamble_tx=99,preamble_delay_list[64];
   uint16_t preamble_max,preamble_energy_max;
   PRACH_RESOURCES_t prach_resources;
-  uint8_t prach_fmt;
-  int N_ZC;
+  //uint8_t prach_fmt;
+  //int N_ZC;
   int delay = 0;
   double delay_avg=0;
   double ue_speed = 0;
@@ -126,7 +128,8 @@ int main(int argc, char **argv)
     case 'a':
       printf("Running AWGN simulation\n");
       awgn_flag = 1;
-      ntrials=1;
+      /* ntrials not used later, no need to set */
+      //ntrials=1;
       break;
 
     case 'd':
@@ -404,9 +407,11 @@ int main(int argc, char **argv)
   PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag=hs_flag;
   PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset=0;
 
-  prach_fmt = get_prach_fmt(PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
-                            PHY_vars_eNB->lte_frame_parms.frame_type);
-  N_ZC = (prach_fmt <4)?839:139;
+  /* N_ZC not used later, so prach_fmt is also useless, don't set */
+  //prach_fmt = get_prach_fmt(PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
+  //                          PHY_vars_eNB->lte_frame_parms.frame_type);
+  /* N_ZC not used later, no need to set */
+  //N_ZC = (prach_fmt <4)?839:139;
 
   compute_prach_seq(&PHY_vars_eNB->lte_frame_parms.prach_config_common,PHY_vars_eNB->lte_frame_parms.frame_type,PHY_vars_eNB->X_u);
 
@@ -430,7 +435,8 @@ int main(int argc, char **argv)
                           subframe,
                           0); //Nf
 
-  tx_lev_dB = (unsigned int) dB_fixed(tx_lev);
+  /* tx_lev_dB not used later, no need to set */
+  //tx_lev_dB = (unsigned int) dB_fixed(tx_lev);
 
   write_output("txsig0_new.m","txs0", &txdata[0][subframe*frame_parms->samples_per_tti],frame_parms->samples_per_tti,1,1);
   //write_output("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
diff --git a/openair2/COMMON/openair_defs.h b/openair2/COMMON/openair_defs.h
index 0a6b88ce332a201aea191996bf822ad5206270f5..c2dd4d0616595266f82b28b5c20b91b85a1c5a6d 100755
--- a/openair2/COMMON/openair_defs.h
+++ b/openair2/COMMON/openair_defs.h
@@ -41,7 +41,13 @@
 #if !defined (msg)
 # define msg(aRGS...) LOG_D(PHY, ##aRGS)
 #endif
-#define malloc16(x) memalign(16,x) //malloc(x)
+#ifndef malloc16
+#  ifdef __AVX2__
+#    define malloc16(x) memalign(32,x)
+#  else
+#    define malloc16(x) memalign(16,x)
+#  endif
+#endif
 #define free16(y,x) free(y)
 #define bigmalloc malloc
 #define bigmalloc16 malloc16
diff --git a/openair2/ENB_APP/enb_app.c b/openair2/ENB_APP/enb_app.c
index 70fb5ad61f676294814e7a84fe6a1dd400a0a513..6d95c215db79c556923786942343296287d26cf8 100644
--- a/openair2/ENB_APP/enb_app.c
+++ b/openair2/ENB_APP/enb_app.c
@@ -285,6 +285,9 @@ void *eNB_app_task(void *args_p)
   instance_t                      instance;
   int                             result;
 
+  /* for no gcc warnings */
+  (void)instance;
+
   itti_mark_task_ready (TASK_ENB_APP);
 
 # if defined(ENABLE_USE_MME)
@@ -420,5 +423,8 @@ void *eNB_app_task(void *args_p)
 
 #endif
 
+  /* for no gcc warnings */
+  (void)enb_properties_p;
+
   return NULL;
 }
diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c
index cc63eb8671dcb2e2a8f12bdb443ee26c393e9485..51d5f3805f22121da975758fe9294afa833e9782 100755
--- a/openair2/ENB_APP/enb_config.c
+++ b/openair2/ENB_APP/enb_config.c
@@ -562,9 +562,9 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
   const char*       pusch_alpha                   = NULL;
   libconfig_int     pucch_p0_Nominal              = 0;
   libconfig_int     msg3_delta_Preamble           = 0;
-  libconfig_int     ul_CyclicPrefixLength         = 0;
+  //libconfig_int     ul_CyclicPrefixLength         = 0;
   const char*       pucch_deltaF_Format1          = NULL;
-  const char*       pucch_deltaF_Format1a         = NULL;
+  //const char*       pucch_deltaF_Format1a         = NULL;
   const char*       pucch_deltaF_Format1b         = NULL;
   const char*       pucch_deltaF_Format2          = NULL;
   const char*       pucch_deltaF_Format2a         = NULL;
@@ -649,6 +649,10 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
   char*             osa_log_level                 = NULL;
   char*             osa_log_verbosity             = NULL;
 
+  /* for no gcc warnings */
+  (void)astring;
+  (void)my_int;
+
   memset((char*) (enb_properties.properties), 0 , MAX_ENB * sizeof(Enb_properties_t *));
   memset((char*)active_enb,     0 , MAX_ENB * sizeof(char*));
 
diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c
index e3f6d8e78c13fc86f900a86a14ef2dfff7b8d1e0..608a67c18a5f5ecc634f062f60dc71d5b3b81512 100644
--- a/openair2/LAYER2/MAC/config.c
+++ b/openair2/LAYER2/MAC/config.c
@@ -275,7 +275,7 @@ rrc_mac_config_req(
     if (eNB_flagP==1) {
       mac_xface->phy_config_dedicated_scell_eNB(Mod_id,UE_RNTI(Mod_id,UE_id),sCellToAddMod_r10,1);
     } else {
-#warning "phy_config_dedicated_scell_ue is empty"
+//#warning "phy_config_dedicated_scell_ue is empty"
       mac_xface->phy_config_dedicated_scell_ue(Mod_id,eNB_index,sCellToAddMod_r10,1);
       UE_mac_inst[Mod_id].physicalConfigDedicatedSCell_r10 = sCellToAddMod_r10->radioResourceConfigDedicatedSCell_r10->physicalConfigDedicatedSCell_r10; // using SCell index 0
     }
diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c
index 21e9337dbb156425e9d5aa4600c75d0c337acf2b..df867693a601dca88743be97e27b88ba11f7f16a 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler.c
@@ -86,7 +86,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
   int mbsfn_status[MAX_NUM_CCs];
   protocol_ctxt_t   ctxt;
 #ifdef EXMIMO
-  int ret;
+  //int ret;
 #endif
 #if defined(ENABLE_ITTI)
   MessageDef   *msg_p;
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_bch.c b/openair2/LAYER2/MAC/eNB_scheduler_bch.c
index 65240356a75cab7ed709554b1c3160b8c18f12a8..f3774777a1b287b7d4fd44a401393b97324a651a 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_bch.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_bch.c
@@ -85,9 +85,9 @@ schedule_SI(
   int CC_id;
   eNB_MAC_INST *eNB = &eNB_mac_inst[module_idP];
   uint8_t *vrb_map;
-  int first_rb;
+  int first_rb = -1;
   int rballoc[MAX_NUM_CCs];
-  int sizeof1A_bytes,sizeof1A_bits;
+  int sizeof1A_bytes,sizeof1A_bits = -1;
   DCI_PDU *DCI_pdu;
 
   start_meas(&eNB->schedule_si);
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
index 2a52d8779a3cdac8f7cce3af4ec258d21f306120..4d8e32b63c353d1d73fc2169179c38a77dd569da 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
@@ -1125,7 +1125,7 @@ schedule_ue_spec(
           if (frame_parms[CC_id]->frame_type == TDD) {
             UE_list->UE_template[CC_id][UE_id].DAI++;
             //  printf("DAI update: subframeP %d: UE %d, DAI %d\n",subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].DAI);
-#warning only for 5MHz channel
+//#warning only for 5MHz channel
             update_ul_dci(module_idP,CC_id,rnti,UE_list->UE_template[CC_id][UE_id].DAI);
           }
 
@@ -1488,23 +1488,23 @@ fill_DLSCH_dci(
 
   // loop over all allocated UEs and compute frequency allocations for PDSCH
   int   UE_id = -1;
-  uint8_t            first_rb,nb_rb=3;
+  uint8_t            /* first_rb, */ nb_rb=3;
   rnti_t        rnti;
-  unsigned char *vrb_map;
+  //unsigned char *vrb_map;
   uint8_t            rballoc_sub[25];
   //uint8_t number_of_subbands=13;
 
-  unsigned char round;
+  //unsigned char round;
   unsigned char harq_pid;
   void         *DLSCH_dci=NULL;
   DCI_PDU      *DCI_pdu;
   int           i;
-  void         *BCCH_alloc_pdu;
+  //void         *BCCH_alloc_pdu;
   int           size_bits,size_bytes;
   int CC_id;
   eNB_MAC_INST *eNB  =&eNB_mac_inst[module_idP];
   UE_list_t    *UE_list = &eNB->UE_list;
-  RA_TEMPLATE  *RA_template;
+  //RA_TEMPLATE  *RA_template;
 
   start_meas(&eNB->fill_DLSCH_dci);
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_FILL_DLSCH_DCI,VCD_FUNCTION_IN);
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_mch.c b/openair2/LAYER2/MAC/eNB_scheduler_mch.c
index e894f3a6621f11bbafe29198922ab998cb91c5d8..a6926e15ad3e5f090ef95667d1d2213f2a0d42a7 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_mch.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_mch.c
@@ -666,7 +666,7 @@ MCH_PDU *get_mch_sdu(module_id_t module_idP, int CC_id, frame_t frameP, sub_fram
 {
   //  eNB_mac_inst[module_idP].MCH_pdu.mcs=0;
   //LOG_D(MAC," MCH_pdu.mcs is %d\n", eNB_mac_inst[module_idP].MCH_pdu.mcs);
-#warning "MCH pdu should take the CC_id index"
+//#warning "MCH pdu should take the CC_id index"
   return(&eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu);
 }
 
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c
index 9cabd6b62233afe563028f478b909fe123dbf684..79529c32848b69d4586b554dee0d2725ce48e9df 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c
@@ -1082,7 +1082,7 @@ boolean_t CCE_allocation_infeasible(int module_idP,
 
 
   DCI_PDU *DCI_pdu = &eNB_mac_inst[module_idP].common_channels[CC_idP].DCI_pdu;
-  DCI_ALLOC_t *dci_alloc;
+  //DCI_ALLOC_t *dci_alloc;
   int ret;
   boolean_t res=FALSE;
 
diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c
index 410d45441944b2cfd12360b4024f5e1dd9d563a2..c744d1d90af6d5ad8b85e5bb3e679d6ec5c80724 100644
--- a/openair2/LAYER2/MAC/pre_processor.c
+++ b/openair2/LAYER2/MAC/pre_processor.c
@@ -748,10 +748,10 @@ void dlsch_scheduler_pre_processor_reset (int module_idP,
   UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list;
   UE_sched_ctrl *ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
   rnti_t rnti = UE_RNTI(module_idP,UE_id);
-  uint8_t *vrb_map = &eNB_mac_inst[module_idP].common_channels[CC_id].vrb_map;
+  uint8_t *vrb_map = eNB_mac_inst[module_idP].common_channels[CC_id].vrb_map;
   int RBGsize = PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL/N_RBG;
 #ifdef SF05_LIMIT
-  int subframe05_limit=0;
+  //int subframe05_limit=0;
   int sf05_upper=-1,sf05_lower=-1;
 #endif
   LTE_eNB_UE_stats *eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti);
@@ -1085,7 +1085,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
 void store_ulsch_buffer(module_id_t module_idP, int frameP, sub_frame_t subframeP)
 {
 
-  int                 UE_id,pCC_id,lcgid;
+  int                 UE_id, /* pCC_id, */ lcgid;
   UE_list_t           *UE_list = &eNB_mac_inst[module_idP].UE_list;
   UE_TEMPLATE         *UE_template;
 
@@ -1231,7 +1231,7 @@ void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP)
   int               UE_id1,UE_id2;
   int               pCCid1,pCCid2;
   int               round1,round2;
-  int               i=0,ii=0,j=0;
+  int               i=0,ii=0;
   rnti_t            rnti1,rnti2;
 
   UE_list_t *UE_list = &eNB_mac_inst[module_idP].UE_list;
diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h
index 9afe098d77fe64df1abc7e66caffb3d762bb5ac4..26656878f6aca88b2b95e0d79b2fa26174d94132 100644
--- a/openair2/LAYER2/MAC/proto.h
+++ b/openair2/LAYER2/MAC/proto.h
@@ -777,6 +777,7 @@ rrc_get_estimated_ue_distance(
   const int         CC_idP,
   const uint8_t     loc_typeP);
 
+void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_eNB);
 
 #endif
 /** @}*/
diff --git a/openair2/LAYER2/MAC/ra_procedures.c b/openair2/LAYER2/MAC/ra_procedures.c
index 43ec8b05ec88c15ea71cb86fa024b5507786e1f2..669077bf4fddde7f649eb779cdde92088d329064 100644
--- a/openair2/LAYER2/MAC/ra_procedures.c
+++ b/openair2/LAYER2/MAC/ra_procedures.c
@@ -152,6 +152,9 @@ void get_prach_resources(module_id_t module_idP,
     }
   }
 
+  /* TODO: gcc warns if this variable is not always set, let's put -1 for no more warning */
+  messageSizeGroupA = -1;
+
   if (!rach_ConfigCommon->preambleInfo.preamblesGroupAConfig) {
     noGroupB = 1;
   } else {
@@ -171,6 +174,8 @@ void get_prach_resources(module_id_t module_idP,
       break;
     }
 
+    /* TODO: what value to use as default? */
+    messagePowerOffsetGroupB = -9999;
     switch (rach_ConfigCommon->preambleInfo.preamblesGroupAConfig->messagePowerOffsetGroupB) {
     case 0:
       messagePowerOffsetGroupB = -9999;
@@ -495,7 +500,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
           UE_mac_inst[module_idP].RA_PREAMBLE_TRANSMISSION_COUNTER++;
           UE_mac_inst[module_idP].RA_prach_resources.ra_PREAMBLE_RECEIVED_TARGET_POWER +=
             (rach_ConfigCommon->powerRampingParameters.powerRampingStep<<1);  // 2dB increments in ASN.1 definition
-	  int preambleTransMax;
+	  int preambleTransMax = -1;
 	  switch (rach_ConfigCommon->ra_SupervisionInfo.preambleTransMax) {
 	  case RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n3:
 	    preambleTransMax = 3;
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c
index f25e921570a7638d34fef297b60e7f8579d103ff..d210b98f6a585411f887234822d01e58d4484b4b 100755
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c
@@ -692,7 +692,7 @@ pdcp_data_ind(
 #if defined(USER_MODE) && defined(OAI_EMU)
 
   if (oai_emulation.info.otg_enabled == 1) {
-    unsigned int dst_instance;
+    //unsigned int dst_instance;
     int    ctime;
 
     if ((pdcp_p->rlc_mode == RLC_MODE_AM)&&(MBMS_flagP==0) ) {
@@ -1032,6 +1032,8 @@ pdcp_remove_UE(
 
   }
 
+  (void)h_rc; /* remove gcc warning "set but not used" */
+
   return 1;
 }
 
@@ -1486,7 +1488,7 @@ pdcp_config_req_asn1 (
 
   case CONFIG_ACTION_REMOVE:
     DevAssert(pdcp_pP != NULL);
-#warning "TODO pdcp_module_id_to_rnti"
+//#warning "TODO pdcp_module_id_to_rnti"
     //pdcp_module_id_to_rnti[ctxt_pP.module_id ][dst_id] = NOT_A_RNTI;
     LOG_D(PDCP, PROTOCOL_PDCP_CTXT_FMT" CONFIG_ACTION_REMOVE LCID %d RBID %d configured\n",
           PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_pP),
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
index 787d463b32c1840f935469e9b92f7a26b495aac3..8ac79a61b9c9cf8a2d4f9fa6eedc659ecd4495b1 100755
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
@@ -313,6 +313,8 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const  ctxt_pP)
   hash_key_t                     key       = HASHTABLE_NOT_A_KEY_VALUE;
   hashtable_rc_t                 h_rc;
   struct pdcp_netlink_element_s* data_p    = NULL;
+  /* avoid gcc warnings */
+  (void)data_p;
   module_id_t                    ue_id     = 0;
   pdcp_t*                        pdcp_p    = NULL;
 # if defined(PDCP_USE_NETLINK_QUEUES)
@@ -492,7 +494,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const  ctxt_pP)
                   pdcp_read_header_g.inst +  oai_emulation.info.first_enb_local;*/
 #else // OAI_EMU
           pdcp_read_header_g.inst = 0;
-#warning "TO DO CORRCT VALUES FOR ue mod id, enb mod id"
+//#warning "TO DO CORRCT VALUES FOR ue mod id, enb mod id"
           ctxt.frame         = ctxt_cpy.frame;
           ctxt.enb_flag      = ctxt_cpy.enb_flag;
 
@@ -565,7 +567,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const  ctxt_pP)
               }
             } else  { // rb_id =0, thus interpreated as broadcast and transported as multiple unicast
               // is a broadcast packet, we have to send this packet on all default RABS of all connected UEs
-#warning CODE TO BE REVIEWED, ONLY WORK FOR SIMPLE TOPOLOGY CASES
+//#warning CODE TO BE REVIEWED, ONLY WORK FOR SIMPLE TOPOLOGY CASES
               for (ue_id = 0; ue_id < NB_UE_INST; ue_id++) {
                 if (oai_emulation.info.eNB_ue_module_id_to_rnti[ctxt_cpy.module_id][ue_id] != NOT_A_RNTI) {
                   ctxt.rnti = oai_emulation.info.eNB_ue_module_id_to_rnti[ctxt_cpy.module_id][ue_id];
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c
index ec303172b01f05051fcd0f2927b60bfd9e5caaf1..0b8abf383832249251b90f65e2817136a14d3b9a 100755
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c
@@ -599,6 +599,7 @@ rlc_am_mac_status_indication (
 			  rlc_sn_t             sn_end       = (rlc->vt_a - 1) & RLC_AM_SN_MASK;
 			  int                  found_pdu    = 0;
 			  rlc_sn_t             found_pdu_sn = 0; // avoid warning
+                          (void)found_pdu_sn; /* avoid gcc warning "set but not used" */
 
 
 			  while (sn != sn_end) {
@@ -681,6 +682,12 @@ rlc_am_mac_data_request (
   MessageDef         *msg_p;
 #   endif
   int                 octet_index, index;
+  /* for no gcc warnings */
+  (void)num_nack;
+  (void)message_string;
+  (void)message_string_size;
+  (void)octet_index;
+  (void)index;
 #endif
 
   list_init (&data_req.data, NULL);
@@ -915,8 +922,16 @@ rlc_am_mac_data_indication (
   MessageDef         *msg_p;
 #   endif
   int                 octet_index, index;
+  /* for no gcc warnings */
+  (void)num_nack;
+  (void)message_string;
+  (void)message_string_size;
+  (void)octet_index;
+  (void)index;
 #endif
 
+  (void)l_rlc_p; /* avoid gcc warning "unused variable" */
+
 #if TRACE_RLC_AM_PDU || MESSAGE_CHART_GENERATOR
 
   if (data_indP.data.nb_elements > 0) {
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.c
index eb2d0c5acac5732dff177ff4606b942e86b59f98..81645f06fef44af1590adc1e1cf0dd4b1ae27170 100755
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.c
@@ -57,7 +57,7 @@ rlc_am_init(
 
     pthread_mutex_init(&rlc_pP->lock_input_sdus, NULL);
     rlc_pP->input_sdus               = calloc(1, RLC_AM_SDU_CONTROL_BUFFER_SIZE*sizeof(rlc_am_tx_sdu_management_t));
-#warning "cast the rlc retrans buffer to uint32"
+//#warning "cast the rlc retrans buffer to uint32"
     //        rlc_pP->pdu_retrans_buffer       = calloc(1, (uint16_t)((unsigned int)RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE*(unsigned int)sizeof(rlc_am_tx_data_pdu_management_t)));
     rlc_pP->pdu_retrans_buffer       = calloc(1, (uint32_t)((unsigned int)RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE*(unsigned int)sizeof(
                                          rlc_am_tx_data_pdu_management_t)));
@@ -114,7 +114,7 @@ rlc_am_reestablish(
   LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[AM REESTABLISH] RE-INIT STATE VARIABLES, BUFFERS, LISTS\n",
         PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
 
-#warning TODO when possible reassemble RLC SDUs from any byte segments of AMD PDUs with SN inf VR(MR)
+//#warning TODO when possible reassemble RLC SDUs from any byte segments of AMD PDUs with SN inf VR(MR)
   list2_free(&rlc_pP->receiver_buffer);
 
   list_free(&rlc_pP->pdus_to_mac_layer);
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c
index e2dda28f957654dbb2295cf190253469fa0a13a0..18ff9a8ad43304de8d3213982d47d22e0ba74769 100755
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c
@@ -516,7 +516,7 @@ void rlc_am_segment_10 (
 
     pdu_tb_req_p->data_ptr        = (unsigned char*)pdu_p;
     pdu_tb_req_p->tb_size         = data_pdu_size - pdu_remaining_size;
-#warning "why 3000: changed to RLC_SDU_MAX_SIZE "
+//#warning "why 3000: changed to RLC_SDU_MAX_SIZE "
     assert(pdu_tb_req_p->tb_size < RLC_SDU_MAX_SIZE );
     rlc_am_pdu_polling(ctxt_pP, rlc_pP, pdu_p, pdu_mngt_p->payload_size);
 
diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c
index 8aab33f54c69677b4e844e0de8c2232879d9d651..7b0c9890ed435ec03ba5f5935b57c2b718770f01 100755
--- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c
+++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c
@@ -745,7 +745,7 @@ rlc_um_data_req (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP, mem_block_t
     /*
      * Print every single octet in hexadecimal form
      */
-    message_string_size += sprintf(&message_string[message_string_size], " %02x", (uint8_t*)(&sdu_pP->data[data_offset])[octet_index]);
+    message_string_size += sprintf(&message_string[message_string_size], " %02x", ((uint8_t*)(&sdu_pP->data[data_offset]))[octet_index]);
     /*
      * Align newline and pipes according to the octets in groups of 2
      */
diff --git a/openair2/LAYER2/RLC/rlc.c b/openair2/LAYER2/RLC/rlc.c
index e19c6b0b0abbb05e0287d6d6d6718550a3b9bf2f..1397387f22a372d794282d597bb3f1e25a74295e 100644
--- a/openair2/LAYER2/RLC/rlc.c
+++ b/openair2/LAYER2/RLC/rlc.c
@@ -602,6 +602,9 @@ rlc_module_init (void)
   int          k;
   module_id_t  module_id1;
 
+  /* for no gcc warnings */
+  (void)k;
+
   LOG_D(RLC, "MODULE INIT\n");
   rlc_rrc_data_ind  = NULL;
   rlc_rrc_data_conf = NULL;
diff --git a/openair2/LAYER2/RLC/rlc_rrc.c b/openair2/LAYER2/RLC/rlc_rrc.c
index 05ad79d7d4fd85d7bc5fb34844071ba990ae8e05..eccea461abac6c1b31b61abf40a2017a77fe6999 100644
--- a/openair2/LAYER2/RLC/rlc_rrc.c
+++ b/openair2/LAYER2/RLC/rlc_rrc.c
@@ -87,6 +87,11 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t   * const ctxt_pP
 
 #endif
 
+  /* for no gcc warnings */
+  (void)rlc_union_p;
+  (void)key;
+  (void)h_rc;
+
   LOG_D(RLC, PROTOCOL_CTXT_FMT" CONFIG REQ ASN1 \n",
         PROTOCOL_CTXT_ARGS(ctxt_pP));
 
@@ -196,7 +201,7 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t   * const ctxt_pP
           break;
 
         case SRB_ToAddMod__rlc_Config_PR_defaultValue:
-#warning TO DO SRB_ToAddMod__rlc_Config_PR_defaultValue
+//#warning TO DO SRB_ToAddMod__rlc_Config_PR_defaultValue
           if (rrc_rlc_add_rlc   (ctxt_pP, SRB_FLAG_YES, MBMS_FLAG_NO, rb_id, lc_id, RLC_MODE_UM) != NULL) {
             config_req_rlc_um_asn1(
               ctxt_pP,
@@ -463,6 +468,9 @@ rlc_op_status_t rrc_rlc_remove_rlc   (
 
 #endif
 
+  /* for no gcc warnings */
+  (void)lcid;
+
 #ifdef Rel10
 
   if (MBMS_flagP == TRUE) {
@@ -634,7 +642,7 @@ rlc_op_status_t rrc_rlc_config_req   (
   const rlc_info_t      rlc_infoP)
 {
   //-----------------------------------------------------------------------------
-  rlc_op_status_t status;
+  //rlc_op_status_t status;
 
   LOG_D(RLC, PROTOCOL_CTXT_FMT" CONFIG_REQ for RAB %u\n",
         PROTOCOL_CTXT_ARGS(ctxt_pP),
diff --git a/openair2/LAYER2/openair2_proc.c b/openair2/LAYER2/openair2_proc.c
index 35684d239aa548b0d5937ccd205dc621c7d60255..e09adaea8c595c8b211c3af56306aa8f6cb5891f 100644
--- a/openair2/LAYER2/openair2_proc.c
+++ b/openair2/LAYER2/openair2_proc.c
@@ -74,7 +74,7 @@ int dump_eNB_l2_stats(char *buffer, int length)
   int eNB_id,UE_id,number_of_cards;
   int len= length;
   int CC_id=0;
-  int i,j;
+  int i;
   protocol_ctxt_t      ctxt;
   rlc_op_status_t rlc_status;
   unsigned int stat_rlc_mode;
@@ -150,7 +150,7 @@ int dump_eNB_l2_stats(char *buffer, int length)
                      eNB->eNB_stats[CC_id].dlsch_pdus_tx,
                      eNB->eNB_stats[CC_id].total_dlsch_pdus_tx);
 
-      len += sprintf(&buffer[len],"ULSCH bitrate (TTI %u, avg %u) kbps, Received bytes (TTI %u, total %u), Received PDU (TTI %u, total %lu) \n",
+      len += sprintf(&buffer[len],"ULSCH bitrate (TTI %u, avg %u) kbps, Received bytes (TTI %u, total %u), Received PDU (TTI %lu, total %u) \n",
                      eNB->eNB_stats[CC_id].ulsch_bitrate,
                      eNB->eNB_stats[CC_id].total_ulsch_bitrate,
                      eNB->eNB_stats[CC_id].ulsch_bytes_rx,
@@ -201,7 +201,7 @@ int dump_eNB_l2_stats(char *buffer, int length)
                        UE_list->eNB_UE_stats[CC_id][UE_id].avg_overhead_bytes
                       );
         
-	len += sprintf(&buffer[len],"[MAC] UE %d (ULSCH), Status %d, RNTI %x : rx power (normalized %d,  target %d), MCS (pre %d, post %d), RB (rx %d, retx %d, total %d), Current TBS %d \n",
+	len += sprintf(&buffer[len],"[MAC] UE %d (ULSCH), Status %s, RNTI %x : rx power (normalized %d,  target %d), MCS (pre %d, post %d), RB (rx %d, retx %d, total %d), Current TBS %d \n",
                        UE_id,
                        map_int_to_str(rrc_status_names, UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status),
                        UE_list->eNB_UE_stats[CC_id][UE_id].crnti,
diff --git a/openair2/PHY_INTERFACE/defs.h b/openair2/PHY_INTERFACE/defs.h
index 7b0367f53791c0481d7af34aca2ce86c1b1e7ca4..c34bec28d74e22781288c2736be78188982499e4 100755
--- a/openair2/PHY_INTERFACE/defs.h
+++ b/openair2/PHY_INTERFACE/defs.h
@@ -241,19 +241,24 @@ typedef struct {
   uint16_t (*get_nCCE_max)(module_id_t Mod_id,uint8_t  CC_id,int num_pdcch_symbols,int subframe);
 
 
-  int (*get_nCCE_offset)(unsigned char L, int nCCE, int common_dci, unsigned short rnti, unsigned char subframe);
+  int (*get_nCCE_offset)(int *CCE_table,
+                         const unsigned char L,
+                         const int nCCE,
+                         const int common_dci,
+                         const unsigned short rnti,
+                         const unsigned char subframe);
 
   /// Function to retrieve number of PRB in an rb_alloc
   uint32_t (*get_nb_rb)(uint8_t ra_header, uint32_t rb_alloc, int n_rb_dl);
 
   /// Function to convert VRB to PRB for distributed allocation
-  int (*get_prb)(int N_RB_DL,int odd_slot,int vrb,int Ngap);
+  uint32_t (*get_prb)(int N_RB_DL,int odd_slot,int vrb,int Ngap);
 
   /// Function to retrieve transmission mode for UE
   uint8_t (*get_transmission_mode)(module_id_t Mod_id,uint8_t CC_id,rnti_t rnti);
 
   /// Function to retrieve rb_alloc bitmap from dci rballoc field and VRB type
-  uint32_t (*get_rballoc)(uint8_t vrb_type, uint16_t rb_alloc_dci);
+  uint32_t (*get_rballoc)(vrb_t vrb_type, uint16_t rb_alloc_dci);
 
   /// Function for UE MAC to retrieve current PHY connectivity mode (PRACH,RA_RESPONSE,PUSCH)
   UE_MODE_t (*get_ue_mode)(module_id_t Mod_id, uint8_t CC_id,uint8_t eNB_index);
diff --git a/openair2/RRC/LITE/L2_interface.c b/openair2/RRC/LITE/L2_interface.c
index 6a64095e92a48020d95612add215cde07d726e81..70d0a20c0862ae9dab0ef445c0af24e24a40b617 100644
--- a/openair2/RRC/LITE/L2_interface.c
+++ b/openair2/RRC/LITE/L2_interface.c
@@ -355,6 +355,10 @@ mac_rrc_lite_data_ind(
   SRB_INFO *Srb_info;
   protocol_ctxt_t ctxt;
   sdu_size_t      sdu_size = 0;
+
+  /* for no gcc warnings */
+  (void)sdu_size;
+
   /*
   int si_window;
    */
@@ -389,7 +393,7 @@ mac_rrc_lite_data_ind(
         itti_send_msg_to_task (TASK_RRC_UE, ctxt.instance, message_p);
       }
 #else
-      decode_BCCH_DLSCH_Message(&ctxt,eNB_indexP,sduP,sdu_lenP, 0, 0);
+      decode_BCCH_DLSCH_Message(&ctxt,eNB_indexP,(uint8_t*)sduP,sdu_lenP, 0, 0);
 #endif
     }
 
@@ -634,7 +638,7 @@ rrc_lite_data_ind(
       buffer_pP,
       sdu_sizeP);
   } else {
-#warning "LG put 0 to arg4 that is eNB index"
+//#warning "LG put 0 to arg4 that is eNB index"
     rrc_ue_decode_dcch(
       ctxt_pP,
       DCCH_index,
diff --git a/openair2/RRC/LITE/rrc_UE.c b/openair2/RRC/LITE/rrc_UE.c
index a919a055f287ef9b7916c92759c475e9e2dc4aec..7da26897e8dc52f16be33892ae98ee1ed3222d56 100644
--- a/openair2/RRC/LITE/rrc_UE.c
+++ b/openair2/RRC/LITE/rrc_UE.c
@@ -141,7 +141,9 @@ static uint8_t check_trigger_meas_event(
   Q_OffsetRange_t ofn, Q_OffsetRange_t ocn, Hysteresis_t hys,
   Q_OffsetRange_t ofs, Q_OffsetRange_t ocs, long a3_offset, TimeToTrigger_t ttt);
 
+#ifdef Rel10
 static void decode_MBSFNAreaConfiguration(module_id_t module_idP, uint8_t eNB_index, frame_t frameP,uint8_t mbsfn_sync_area);
+#endif
 
 
 
@@ -151,10 +153,13 @@ static void decode_MBSFNAreaConfiguration(module_id_t module_idP, uint8_t eNB_in
 
 
 /*------------------------------------------------------------------------------*/
+/* to avoid gcc warnings when compiling with certain options */
+#if defined(ENABLE_USE_MME) || ENABLE_RAL
 static Rrc_State_t rrc_get_state (module_id_t ue_mod_idP)
 {
   return UE_rrc_inst[ue_mod_idP].RrcState;
 }
+#endif
 
 static Rrc_Sub_State_t rrc_get_sub_state (module_id_t ue_mod_idP)
 {
@@ -261,6 +266,7 @@ static void init_SI_UE( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_
 
 #ifdef Rel10
 //-----------------------------------------------------------------------------
+#if 0
 static void init_MCCH_UE(module_id_t ue_mod_idP, uint8_t eNB_index)
 {
   int i;
@@ -274,6 +280,7 @@ static void init_MCCH_UE(module_id_t ue_mod_idP, uint8_t eNB_index)
   }
 }
 #endif
+#endif
 
 //-----------------------------------------------------------------------------
 static void openair_rrc_lite_ue_init_security( const protocol_ctxt_t* const ctxt_pP )
@@ -697,6 +704,10 @@ rrc_ue_establish_drb(
   // add descriptor from RRC PDU
 #ifdef PDCP_USE_NETLINK
   int oip_ifup=0,ip_addr_offset3=0,ip_addr_offset4=0;
+  /* avoid gcc warnings */
+  (void)oip_ifup;
+  (void)ip_addr_offset3;
+  (void)ip_addr_offset4;
 #endif
 
   LOG_I(RRC,"[UE %d] Frame %d: processing RRCConnectionReconfiguration: reconfiguring DRB %ld/LCID %d\n",
@@ -1296,7 +1307,7 @@ rrc_ue_process_radioResourceConfigDedicated(
     UE_rrc_inst[ctxt_pP->module_id].sib1[eNB_index]->cellAccessRelatedInfo.cellIdentity.buf[1],
     UE_rrc_inst[ctxt_pP->module_id].sib1[eNB_index]->cellAccessRelatedInfo.cellIdentity.buf[2],
     UE_rrc_inst[ctxt_pP->module_id].sib1[eNB_index]->cellAccessRelatedInfo.cellIdentity.buf[3]);
-#    endif OAI_EMU
+#    endif /* OAI_EMU */
 #endif
 }
 
@@ -2266,6 +2277,9 @@ static const char* SIB2preambleTransMax( long value )
   case 10:
     return "n200";
   }
+
+  /* unreachable but gcc warns... */
+  return "ERR";
 }
 static const char* SIB2ra_ResponseWindowSize( long value )
 {
@@ -3061,9 +3075,10 @@ uint64_t arfcn_to_freq(long arfcn) {
     return((uint64_t)3400000000 + ((arfcn-41590)*100000));
   else if (arfcn <45590) // Band 43
     return((uint64_t)3600000000 + ((arfcn-43950)*100000));
-  else
+  else {
     LOG_E(RRC,"Unknown EARFCN %d\n",arfcn);
-
+    exit(1);
+  }
 }
 static void dump_sib5( SystemInformationBlockType5_t *sib5 )
 {
diff --git a/openair2/RRC/LITE/rrc_common.c b/openair2/RRC/LITE/rrc_common.c
index e2d8a6c69b2a00b7b894c43706fef230bed9e2e3..86a3197d1e4d28f7a94775ec6709b8a619055b45 100644
--- a/openair2/RRC/LITE/rrc_common.c
+++ b/openair2/RRC/LITE/rrc_common.c
@@ -253,6 +253,9 @@ openair_rrc_top_init(
   OAI_UECapability_t *UECap     = NULL;
   int                 CC_id;
 
+  /* for no gcc warnings */
+  (void)CC_id;
+
   LOG_D(RRC, "[OPENAIR][INIT] Init function start: NB_UE_INST=%d, NB_eNB_INST=%d\n", NB_UE_INST, NB_eNB_INST);
 
   if (NB_UE_INST > 0) {
@@ -411,7 +414,7 @@ rrc_rx_tx(
 )
 //-----------------------------------------------------------------------------
 {
-  uint8_t        UE_id;
+  //uint8_t        UE_id;
   int32_t        current_timestamp_ms, ref_timestamp_ms;
   struct timeval ts;
 #ifdef LOCALIZATION
@@ -547,6 +550,9 @@ rrc_rx_tx(
     }
 
 #endif
+    (void)ts; /* remove gcc warning "unused variable" */
+    (void)ref_timestamp_ms; /* remove gcc warning "unused variable" */
+    (void)current_timestamp_ms; /* remove gcc warning "unused variable" */
   }
 
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_OUT);
diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c
index 1d0b5f290256d4fd3a095cd93271b702c2c8e817..42e28f752f0f6c971b84da7f7a12a63253cfa675 100644
--- a/openair2/RRC/LITE/rrc_eNB.c
+++ b/openair2/RRC/LITE/rrc_eNB.c
@@ -796,6 +796,8 @@ rrc_eNB_free_UE(
   protocol_ctxt_t                     ctxt;
 #if !defined(ENABLE_USE_MME)
   module_id_t                         ue_module_id;
+  /* avoid gcc warnings */
+  (void)ue_module_id;
 #endif
   AssertFatal(enb_mod_idP < NB_eNB_INST, "eNB inst invalid (%d/%d) for UE %x!", enb_mod_idP, NB_eNB_INST, rntiP);
   ue_context_p = rrc_eNB_get_ue_context(
@@ -1131,8 +1133,8 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
   int                                 i;
 
   // configure SRB1/SRB2, PhysicalConfigDedicated, MAC_MainConfig for UE
-  eNB_RRC_INST*                       rrc_inst = &eNB_rrc_inst[ctxt_pP->module_id];
-  struct PhysicalConfigDedicated**    physicalConfigDedicated = &ue_context_pP->ue_context.physicalConfigDedicated;
+  //eNB_RRC_INST*                       rrc_inst = &eNB_rrc_inst[ctxt_pP->module_id];
+  //struct PhysicalConfigDedicated**    physicalConfigDedicated = &ue_context_pP->ue_context.physicalConfigDedicated;
 
   struct SRB_ToAddMod                *SRB2_config                      = NULL;
   struct SRB_ToAddMod__rlc_Config    *SRB2_rlc_config                  = NULL;
@@ -1163,7 +1165,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
 #if Rel10
   long                               *sr_ProhibitTimer_r9              = NULL;
   //     uint8_t sCellIndexToAdd = rrc_find_free_SCell_index(enb_mod_idP, ue_mod_idP, 1);
-  uint8_t                            sCellIndexToAdd = 0;
+  //uint8_t                            sCellIndexToAdd = 0;
 #endif
 
   long                               *logicalchannelgroup, *logicalchannelgroup_drb;
@@ -1176,6 +1178,8 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
   CellsToAddModList_t                *CellsToAddModList                = NULL;
   struct RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList *dedicatedInfoNASList = NULL;
   DedicatedInfoNAS_t                 *dedicatedInfoNas                 = NULL;
+  /* for no gcc warnings */
+  (void)dedicatedInfoNas;
 
   C_RNTI_t                           *cba_RNTI                         = NULL;
 #ifdef CBA
@@ -1288,6 +1292,10 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
   DRB_pdcp_config->rlc_AM = NULL;
   DRB_pdcp_config->rlc_UM = NULL;
 
+  /* avoid gcc warnings */
+  (void)PDCP_rlc_AM;
+  (void)PDCP_rlc_UM;
+
 #ifdef RRC_DEFAULT_RAB_IS_AM // EXMIMO_IOT
   PDCP_rlc_AM = CALLOC(1, sizeof(*PDCP_rlc_AM));
   DRB_pdcp_config->rlc_AM = PDCP_rlc_AM;
@@ -2097,8 +2105,8 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
   QuantityConfig_t                   *quantityConfig;
   MobilityControlInfo_t              *mobilityInfo;
   // HandoverCommand_t handoverCommand;
-  uint8_t                             sourceModId =
-    get_adjacent_cell_mod_id(ue_context_pP->ue_context.handover_info->as_context.reestablishmentInfo->sourcePhysCellId);
+  //uint8_t                             sourceModId =
+  //  get_adjacent_cell_mod_id(ue_context_pP->ue_context.handover_info->as_context.reestablishmentInfo->sourcePhysCellId);
 #if Rel10
   long                               *sr_ProhibitTimer_r9;
 #endif
@@ -2945,7 +2953,7 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
      handoverCommand.criticalExtensions.choice.c1.choice.handoverCommand_r8.handoverCommandMessage.buf = buffer;
      handoverCommand.criticalExtensions.choice.c1.choice.handoverCommand_r8.handoverCommandMessage.size = size;
    */
-#warning "COMPILATION PROBLEM"
+//#warning "COMPILATION PROBLEM"
 #ifdef PROBLEM_COMPILATION_RESOLVED
 
   if (sourceModId != 0xFF) {
@@ -3003,6 +3011,10 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
   int                                 oip_ifup = 0;
   int                                 dest_ip_offset = 0;
   module_id_t                         ue_module_id   = -1;
+  /* avoid gcc warnings */
+  (void)oip_ifup;
+  (void)dest_ip_offset;
+  (void)ue_module_id;
 #endif
 
   uint8_t                            *kRRCenc = NULL;
@@ -3010,7 +3022,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
   uint8_t                            *kUPenc = NULL;
 
   DRB_ToAddModList_t*                 DRB_configList = ue_context_pP->ue_context.DRB_configList;
-  SRB_ToAddModList_t*                 SRB_configList = ue_context_pP->ue_context.SRB_configList;
+  //SRB_ToAddModList_t*                 SRB_configList = ue_context_pP->ue_context.SRB_configList;
 
 #if defined(ENABLE_SECURITY)
 
@@ -3700,7 +3712,7 @@ rrc_eNB_decode_ccch(
              * the current one must be removed from MAC/PHY (zombie UE)
              */
             if ((ue_context_p = rrc_eNB_ue_context_random_exist(ctxt_pP, random_value))) {
-#warning "TODO: random_exist: remove UE from MAC/PHY (how?)"
+//#warning "TODO: random_exist: remove UE from MAC/PHY (how?)"
 	      //              AssertFatal(0 == 1, "TODO: remove UE from MAC/PHY (how?)");
               ue_context_p = NULL;
             } else {
@@ -3713,7 +3725,7 @@ rrc_eNB_decode_ccch(
             m_tmsi_t   m_tmsi   = BIT_STRING_to_uint32(&s_TMSI.m_TMSI);
             random_value = (((uint64_t)mme_code) << 32) | m_tmsi;
             if ((ue_context_p = rrc_eNB_ue_context_stmsi_exist(ctxt_pP, mme_code, m_tmsi))) {
-#warning "TODO: stmsi_exist: remove UE from MAC/PHY (how?)"
+//#warning "TODO: stmsi_exist: remove UE from MAC/PHY (how?)"
 	      //   AssertFatal(0 == 1, "TODO: remove UE from MAC/PHY (how?)");
               ue_context_p = NULL;
             } else {
@@ -4175,7 +4187,7 @@ rrc_eNB_decode_dcch(
       // cancel the security mode in PDCP
 
       // followup with the remaining procedure
-#warning "LG Removed rrc_eNB_generate_UECapabilityEnquiry after receiving securityModeFailure"
+//#warning "LG Removed rrc_eNB_generate_UECapabilityEnquiry after receiving securityModeFailure"
       rrc_eNB_generate_UECapabilityEnquiry(ctxt_pP, ue_context_p);
       break;
 
@@ -4443,7 +4455,7 @@ rrc_enb_task(
       //SPECTRA: Add the RRC connection reconfiguration with Second cell configuration
     case RRC_RAL_CONNECTION_RECONFIGURATION_REQ:
       //                 ue_mod_id = 0; /* TODO force ue_mod_id to first UE, NAS UE not virtualized yet */
-#warning "TODO GET RIGHT RNTI"
+//#warning "TODO GET RIGHT RNTI"
       PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt,
                                     instance,
                                     ENB_FLAG_YES,
diff --git a/openair2/RRC/LITE/rrc_eNB_GTPV1U.c b/openair2/RRC/LITE/rrc_eNB_GTPV1U.c
index b85933ad47525290d2ccbaeeb01f05672c57fe52..29ff0d9dc2994f7ee83f4163deccf35233717323 100755
--- a/openair2/RRC/LITE/rrc_eNB_GTPV1U.c
+++ b/openair2/RRC/LITE/rrc_eNB_GTPV1U.c
@@ -86,6 +86,7 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
 			  create_tunnel_resp_pP->num_tunnels,
 			  ue_context_p->ue_context.enb_gtp_ebi[0],
 			  ue_context_p->ue_context.enb_gtp_teid[0]);
+        (void)rnti; /* avoid gcc warning "set but not used" */
     return 0;
   } else {
     return -1;
diff --git a/openair2/RRC/LITE/rrc_eNB_S1AP.c b/openair2/RRC/LITE/rrc_eNB_S1AP.c
index d93b8eea2fd39d62c0705915eb565acc3b3134db..e5738472c8098866dde11e1d867dc9736ef837f3 100644
--- a/openair2/RRC/LITE/rrc_eNB_S1AP.c
+++ b/openair2/RRC/LITE/rrc_eNB_S1AP.c
@@ -60,6 +60,9 @@
 #endif
 #include "msc.h"
 
+#include "gtpv1u_eNB_task.h"
+#include "RRC/LITE/rrc_eNB_GTPV1U.h"
+
 /* Value to indicate an invalid UE initial id */
 static const uint16_t UE_INITIAL_ID_INVALID = 0;
 
@@ -233,7 +236,7 @@ rrc_eNB_get_ue_context_from_s1ap_ids(
 static e_SecurityAlgorithmConfig__cipheringAlgorithm rrc_eNB_select_ciphering(uint16_t algorithms)
 {
 
-#warning "Forced   return SecurityAlgorithmConfig__cipheringAlgorithm_eea0, to be deleted in future"
+//#warning "Forced   return SecurityAlgorithmConfig__cipheringAlgorithm_eea0, to be deleted in future"
   return SecurityAlgorithmConfig__cipheringAlgorithm_eea0;
 
   if (algorithms & S1AP_ENCRYPTION_EEA2_MASK) {
@@ -392,6 +395,7 @@ rrc_pdcp_config_security(
 #define DEBUG_SECURITY 1
 
 #if defined (DEBUG_SECURITY)
+#undef msg
 #define msg printf
 
   if (print_keys ==1 ) {
@@ -671,7 +675,7 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
       if (rrcConnectionSetupComplete->registeredMME != NULL) {
         /* Fill GUMMEI */
         struct RegisteredMME *r_mme = rrcConnectionSetupComplete->registeredMME;
-        int selected_plmn_identity = rrcConnectionSetupComplete->selectedPLMN_Identity;
+        //int selected_plmn_identity = rrcConnectionSetupComplete->selectedPLMN_Identity;
 
         S1AP_NAS_FIRST_REQ (message_p).ue_identity.presenceMask |= UE_IDENTITIES_gummei;
 
@@ -858,7 +862,7 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char
 {
   uint16_t                        ue_initial_id;
   uint32_t                        eNB_ue_s1ap_id;
-  MessageDef                     *message_gtpv1u_p = NULL;
+  //MessageDef                     *message_gtpv1u_p = NULL;
   gtpv1u_enb_create_tunnel_req_t  create_tunnel_req;
   gtpv1u_enb_create_tunnel_resp_t create_tunnel_resp;
 
@@ -1169,7 +1173,7 @@ int rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND (MessageDef *msg_p, const ch
     */
     {
       int      e_rab;
-      int      mod_id = 0;
+      //int      mod_id = 0;
       MessageDef *msg_delete_tunnels_p = NULL;
 
       MSC_LOG_TX_MESSAGE(
diff --git a/openair2/RRC/LITE/rrc_eNB_S1AP.h b/openair2/RRC/LITE/rrc_eNB_S1AP.h
index ea797e8c20de80664e889f94cd11a5e65b48e81c..93a213c06fbcec73bd74f95c70e44fa2ae20f97e 100644
--- a/openair2/RRC/LITE/rrc_eNB_S1AP.h
+++ b/openair2/RRC/LITE/rrc_eNB_S1AP.h
@@ -63,6 +63,8 @@ rrc_eNB_S1AP_compare_ue_ids(
   struct rrc_ue_s1ap_ids_s* c2_pP
 );
 
+struct rrc_rnti_tree_s;
+
 RB_PROTOTYPE(rrc_rnti_tree_s, rrc_ue_s1ap_ids_s, entries, rrc_eNB_S1AP_compare_ue_ids);
 
 struct rrc_ue_s1ap_ids_s*
diff --git a/openair2/RRC/LITE/vars.h b/openair2/RRC/LITE/vars.h
index 122dea1df2504ac576919c40b1cc002e4c078104..cb6e8c52382975cc77b44679f70cedb83ea120e4 100644
--- a/openair2/RRC/LITE/vars.h
+++ b/openair2/RRC/LITE/vars.h
@@ -88,18 +88,24 @@ struct LogicalChannelConfig__ul_SpecificParameters LCSRB2 =  {3,
 };
 
 
+#ifdef Rel10
+struct LogicalChannelConfig__ext1 logicalChannelSR_Mask_r9_ext1 = {
+         logicalChannelSR_Mask_r9: &logicalChannelSR_Mask_r9
+};
+#endif
+
 // These are the default SRB configurations from 36.331 (Chapter 9, p. 176-179 in v8.6)
-LogicalChannelConfig_t  SRB1_logicalChannelConfig_defaultValue = {&LCSRB1
+LogicalChannelConfig_t  SRB1_logicalChannelConfig_defaultValue = {ul_SpecificParameters: &LCSRB1
 #ifdef Rel10
                                                                   ,
-                                                                  &logicalChannelSR_Mask_r9
+                                                                  ext1: &logicalChannelSR_Mask_r9_ext1
 #endif
                                                                  };
 
-LogicalChannelConfig_t SRB2_logicalChannelConfig_defaultValue = {&LCSRB2
+LogicalChannelConfig_t SRB2_logicalChannelConfig_defaultValue = {ul_SpecificParameters: &LCSRB2
 #ifdef Rel10
                                                                  ,
-                                                                 &logicalChannelSR_Mask_r9
+                                                                 ext1: &logicalChannelSR_Mask_r9_ext1
 #endif
                                                                 };
 
diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_new.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_new.c
index 477887e76f745c589ea308be9cf99ad03b74c5de..2eeae80097f2e85ca6bb40e95d0a5a346c48b6b8 100644
--- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_new.c
+++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_new.c
@@ -48,7 +48,7 @@ int lfds611_freelist_new( struct lfds611_freelist_state **fs, lfds611_atom_t num
 
 
 /****************************************************************************/
-#pragma warning( disable : 4100 )
+//#pragma warning( disable : 4100 )
 
 void lfds611_freelist_use( struct lfds611_freelist_state *fs )
 {
@@ -59,7 +59,7 @@ void lfds611_freelist_use( struct lfds611_freelist_state *fs )
   return;
 }
 
-#pragma warning( default : 4100 )
+//#pragma warning( default : 4100 )
 
 
 
diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_delete.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_delete.c
index 718cfe1ae9fe99bda101828c4134f11de83f600a..a11b501e56f4ff1dde5157e36807e90d190198b6 100644
--- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_delete.c
+++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_delete.c
@@ -41,7 +41,7 @@ void lfds611_queue_delete( struct lfds611_queue_state *qs, void (*user_data_dele
 
 
 /****************************************************************************/
-#pragma warning( disable : 4100 )
+//#pragma warning( disable : 4100 )
 
 void lfds611_queue_internal_freelist_delete_function( void *user_data, void *user_state )
 {
@@ -53,5 +53,5 @@ void lfds611_queue_internal_freelist_delete_function( void *user_data, void *use
   return;
 }
 
-#pragma warning( default : 4100 )
+//#pragma warning( default : 4100 )
 
diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_new.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_new.c
index accc6c3769bfb63ba2913f91339039aa998378cf..7fec0a2e9024940431b27a02294953408764bd10 100644
--- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_new.c
+++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_new.c
@@ -46,7 +46,7 @@ int lfds611_queue_new( struct lfds611_queue_state **qs, lfds611_atom_t number_el
 
 
 /****************************************************************************/
-#pragma warning( disable : 4100 )
+//#pragma warning( disable : 4100 )
 
 void lfds611_queue_use( struct lfds611_queue_state *qs )
 {
@@ -57,14 +57,14 @@ void lfds611_queue_use( struct lfds611_queue_state *qs )
   return;
 }
 
-#pragma warning( default : 4100 )
+//#pragma warning( default : 4100 )
 
 
 
 
 
 /****************************************************************************/
-#pragma warning( disable : 4100 )
+//#pragma warning( disable : 4100 )
 
 int lfds611_queue_internal_freelist_init_function( void **user_data, void *user_state )
 {
@@ -82,7 +82,7 @@ int lfds611_queue_internal_freelist_init_function( void **user_data, void *user_
   return( rv );
 }
 
-#pragma warning( default : 4100 )
+//#pragma warning( default : 4100 )
 
 
 
diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_query.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_query.c
index 2a546dde39d3f904e4197e6fbfc407db3b1c725a..504485d7b5b278f7232ad093bbc4691926adbf31 100644
--- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_query.c
+++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_query.c
@@ -5,7 +5,7 @@
 
 
 /****************************************************************************/
-#pragma warning( disable : 4100 )
+//#pragma warning( disable : 4100 )
 
 void lfds611_queue_query( struct lfds611_queue_state *qs, enum lfds611_queue_query_type query_type, void *query_input, void *query_output )
 {
@@ -31,7 +31,7 @@ void lfds611_queue_query( struct lfds611_queue_state *qs, enum lfds611_queue_que
   return;
 }
 
-#pragma warning( default : 4100 )
+//#pragma warning( default : 4100 )
 
 
 
diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_new.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_new.c
index 2fafe52a372ab8603c354b712c8715535639478d..6d8dde2a54adf42fa45277a6af58e7050989078b 100644
--- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_new.c
+++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_new.c
@@ -48,7 +48,7 @@ int lfds611_ringbuffer_new( struct lfds611_ringbuffer_state **rs, lfds611_atom_t
 
 
 /****************************************************************************/
-#pragma warning( disable : 4100 )
+//#pragma warning( disable : 4100 )
 
 void lfds611_ringbuffer_use( struct lfds611_ringbuffer_state *rs )
 {
@@ -59,5 +59,5 @@ void lfds611_ringbuffer_use( struct lfds611_ringbuffer_state *rs )
   return;
 }
 
-#pragma warning( default : 4100 )
+//#pragma warning( default : 4100 )
 
diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_query.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_query.c
index ad3d56a7884d066cbeced84815cc3e2456c5768d..11bf8b0b6e0deb1b96d1bc9cc9e62386bfa32b12 100644
--- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_query.c
+++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_query.c
@@ -5,7 +5,7 @@
 
 
 /****************************************************************************/
-#pragma warning( disable : 4100 )
+//#pragma warning( disable : 4100 )
 
 void lfds611_ringbuffer_query( struct lfds611_ringbuffer_state *rs, enum lfds611_ringbuffer_query_type query_type, void *query_input, void *query_output )
 {
@@ -26,7 +26,7 @@ void lfds611_ringbuffer_query( struct lfds611_ringbuffer_state *rs, enum lfds611
   return;
 }
 
-#pragma warning( default : 4100 )
+//#pragma warning( default : 4100 )
 
 
 
diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_new.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_new.c
index 7142694a673c0815f264fec43672f474dec7e4ed..b48e349ab0b2203a369bee7f8a667c970277f2c8 100644
--- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_new.c
+++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_new.c
@@ -31,7 +31,7 @@ int lfds611_slist_new( struct lfds611_slist_state **ss, void (*user_data_delete_
 
 
 /****************************************************************************/
-#pragma warning( disable : 4100 )
+//#pragma warning( disable : 4100 )
 
 void lfds611_slist_use( struct lfds611_slist_state *ss )
 {
@@ -42,7 +42,7 @@ void lfds611_slist_use( struct lfds611_slist_state *ss )
   return;
 }
 
-#pragma warning( default : 4100 )
+//#pragma warning( default : 4100 )
 
 
 
diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_delete.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_delete.c
index 6a79156a52353189a94a9740e88623b897157ddd..75700e6b3959c3447d846970b3f09c705dc08bec 100644
--- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_delete.c
+++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_delete.c
@@ -51,7 +51,7 @@ void lfds611_stack_clear( struct lfds611_stack_state *ss, void (*user_data_clear
 
 
 /****************************************************************************/
-#pragma warning( disable : 4100 )
+//#pragma warning( disable : 4100 )
 
 void lfds611_stack_internal_freelist_delete_function( void *user_data, void *user_state )
 {
@@ -63,5 +63,5 @@ void lfds611_stack_internal_freelist_delete_function( void *user_data, void *use
   return;
 }
 
-#pragma warning( default : 4100 )
+//#pragma warning( default : 4100 )
 
diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_new.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_new.c
index 820e51bcc51642fe48fc54507f856fb787b43c71..927f28c88c8e71f7ba7f78652e4dd8593946dec6 100644
--- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_new.c
+++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_new.c
@@ -42,7 +42,7 @@ int lfds611_stack_new( struct lfds611_stack_state **ss, lfds611_atom_t number_el
 
 
 /****************************************************************************/
-#pragma warning( disable : 4100 )
+//#pragma warning( disable : 4100 )
 
 void lfds611_stack_use( struct lfds611_stack_state *ss )
 {
@@ -53,14 +53,14 @@ void lfds611_stack_use( struct lfds611_stack_state *ss )
   return;
 }
 
-#pragma warning( default : 4100 )
+//#pragma warning( default : 4100 )
 
 
 
 
 
 /****************************************************************************/
-#pragma warning( disable : 4100 )
+//#pragma warning( disable : 4100 )
 
 int lfds611_stack_internal_freelist_init_function( void **user_data, void *user_state )
 {
@@ -78,7 +78,7 @@ int lfds611_stack_internal_freelist_init_function( void **user_data, void *user_
   return( rv );
 }
 
-#pragma warning( default : 4100 )
+//#pragma warning( default : 4100 )
 
 
 
diff --git a/openair2/UTIL/LOG/log.c b/openair2/UTIL/LOG/log.c
index abbdbc01abf341236d01234442c042fbe25699da..0ef8f99d71fab2fd95caa6642226414e0900f659 100755
--- a/openair2/UTIL/LOG/log.c
+++ b/openair2/UTIL/LOG/log.c
@@ -698,6 +698,10 @@ void logRecord_mt(const char *file, const char *func, int line, int comp,
   char *log_start;
   char *log_end;
 
+  /* for no gcc warnings */
+  (void)log_start;
+  (void)log_end;
+
   c = &g_log->log_component[comp];
 
   // do not apply filtering for LOG_F
@@ -971,6 +975,10 @@ void logRecord_mt(const char *file, const char *func, int line, int comp,
    */
   char log_buffer[MAX_LOG_TOTAL];
 
+  /* for no gcc warnings */
+  (void)log_start;
+  (void)log_end;
+
   c = &g_log->log_component[comp];
 
   // do not apply filtering for LOG_F
diff --git a/openair2/UTIL/OMG/common.c b/openair2/UTIL/OMG/common.c
index dd12cb302aac4e475d0479371d00858bdf094c08..d02ccf63ced28432fa8bfbe1d9ea40cbb1711387 100644
--- a/openair2/UTIL/OMG/common.c
+++ b/openair2/UTIL/OMG/common.c
@@ -158,6 +158,7 @@ remove_node_entry (node_struct * node, node_list * node_vector)
 
       if (list->next->node->id == node->id) {
         toremove = tmp; // TODO delete the entry
+        (void)toremove; /* avoid gcc warning "set but not used" */
         tmp = list->next->next;
 
         if (tmp != NULL) {
@@ -259,13 +260,11 @@ node_list *
 remove_node (node_list * list, int nid, int node_type)
 {
 
-  int found;
   node_list *current = NULL, *previous = NULL;
 
   //int cond=0;
   //int i=0;
   if (list == NULL) {
-    found = 1;    //false
     return NULL;
   } else {
     //start search
@@ -280,12 +279,10 @@ remove_node (node_list * list, int nid, int node_type)
 
     //holds: current = NULL or  type != node_type or.., but not both
     if (current == NULL) {
-      found = 1;
       LOG_E (OMG, " Element to remove is not found\n ");
       return NULL;
     }     //value not found
     else {
-      found = 0;    // true                value found
 
       if (current == list) {
         list = current->next;
@@ -322,7 +319,6 @@ node_struct *
 find_node (node_list * list, int nid, int node_type)
 {
 
-  int found;
   node_list *current;
 
   if (list == NULL) {
@@ -340,7 +336,6 @@ find_node (node_list * list, int nid, int node_type)
 
     //holds: current = NULL or  type != node_type or.., but not both
     if (current == NULL) {
-      found = 1;
       LOG_D (OMG,
              " Element to find in Node_Vector with ID: %d could not be found\n ",
              nid);
@@ -380,7 +375,7 @@ node_list *
 reset_node_list (node_list * list)
 {
   node_list *tmp;
-  node_list *last = list;
+  //node_list *last = list;
 
   if (list == NULL) {
     //printf("Node_list is NULL\n");
diff --git a/openair2/UTIL/OMG/omg.c b/openair2/UTIL/OMG/omg.c
index 11bdc62071207565f6d47c56c778d9b94123d49e..12b9395f750422d37d9d27543f5a5c64eb6d22c6 100644
--- a/openair2/UTIL/OMG/omg.c
+++ b/openair2/UTIL/OMG/omg.c
@@ -301,7 +301,7 @@ set_new_mob_type (int id, int node_t, int mob_t, double cur_time)
 
   int prev_mob;
   node_list *tmp;
-  job_list *tmp2, *prev_job;
+  //job_list *tmp2, *prev_job;
   pair_struct *pair;
   double pause_p;
 
diff --git a/openair2/UTIL/OMG/steadystaterwp.c b/openair2/UTIL/OMG/steadystaterwp.c
index c466f3cd2316a2c044b0e6fbb359e8c276dde3fd..ba2e0d88f7ba535b70bf36c3c4026ec5029cbc0f 100644
--- a/openair2/UTIL/OMG/steadystaterwp.c
+++ b/openair2/UTIL/OMG/steadystaterwp.c
@@ -173,7 +173,7 @@ place_steadystaterwp_node (node_struct * node)
 void
 sleep_steadystaterwp_node (pair_struct * pair, double cur_time)
 {
-  static int initial = 1;
+  //static int initial = 1;
   node_struct *node;
   node = pair->b;
   node->mobile = 0;
@@ -209,10 +209,10 @@ sleep_steadystaterwp_node (pair_struct * pair, double cur_time)
 void
 move_steadystaterwp_node (pair_struct * pair, double cur_time)
 {
-  static int initial = 1;
+  //static int initial = 1;
   double distance, journeytime_next, max_distance;
   double temp_x, temp_y, u1, u2;
-  int loc_num;
+  //int loc_num;
   double pr, block_xmin, block_ymin;
 
   //LOG_D (OMG, "[STEADY_RWP] move node: %d\n", node->ID);
diff --git a/openair2/UTIL/OMG/sumo.c b/openair2/UTIL/OMG/sumo.c
index f709a73e2a946305fee222083416c43d543e079e..4af34d0bc126730d63e844c169fef99d99674c1e 100644
--- a/openair2/UTIL/OMG/sumo.c
+++ b/openair2/UTIL/OMG/sumo.c
@@ -70,7 +70,7 @@ start_sumo_generator (omg_global_param omg_param_list)
 
   if ((pid = fork ()) == 0) {
     // Start SUMO in the child process
-    system (sumo_line);
+    if (system (sumo_line)) ;  /* this if for no gcc warnings */
     //childs addresss space
   }
 
diff --git a/openair2/UTIL/OMG/trace.c b/openair2/UTIL/OMG/trace.c
index 89a9377f93d2dbb7140a2bbf6e412dee0fd498ca..144b9ae597a1cd4384d7256519ab12b7fc4657bc 100644
--- a/openair2/UTIL/OMG/trace.c
+++ b/openair2/UTIL/OMG/trace.c
@@ -55,7 +55,7 @@ int
 start_trace_generator (omg_global_param omg_param_list)
 {
   double cur_time = 0.0;
-  int immobile = 0;
+  //int immobile = 0;
   int node_number;
   node_struct *node = NULL;
   mobility_struct *mobility = NULL;
@@ -235,7 +235,7 @@ schedule_trace_node (pair_struct * pair, node_data * n_data, double cur_time)
 void
 sleep_trace_node (pair_struct * pair, node_data * n_data, double cur_time)
 {
-  double journeytime, distance;
+  //double journeytime, distance;
   node_struct *node = pair->b;
   node->mobile = 0;
   node->mob->speed = 0.0;
diff --git a/openair2/UTIL/OMG/trace_hashtable.c b/openair2/UTIL/OMG/trace_hashtable.c
index 2ecb3922193b0d3473d70308160755b884b99fe7..51f745de8906a234cc9b26126cda5eee0e2c7336 100644
--- a/openair2/UTIL/OMG/trace_hashtable.c
+++ b/openair2/UTIL/OMG/trace_hashtable.c
@@ -58,8 +58,6 @@ hash_table_t **table;
 void
 create_new_table (int node_type)
 {
-  int i;
-
   if(table==NULL)
     table = (hash_table_t **) calloc (MAX_NUM_NODE_TYPES, sizeof (hash_table_t*));
 
diff --git a/openair2/UTIL/OMV/structures.h b/openair2/UTIL/OMV/structures.h
index f3b2b69d73d79e0f4645257a537c76423d050a1a..6c131371cb93f239bd2225fe95586ff5669c6b15 100755
--- a/openair2/UTIL/OMV/structures.h
+++ b/openair2/UTIL/OMV/structures.h
@@ -44,7 +44,9 @@
 #define Maxneighbor 64
 #define NUMBER_OF_UE_MAX 64
 #define NUMBER_OF_eNB_MAX 3
-#define NB_ANTENNAS_RX  4
+#ifndef NB_ANTENNAS_RX
+#  define NB_ANTENNAS_RX  4
+#endif
 #endif
 //
 
diff --git a/openair2/UTIL/OSA/osa_stream_eea.c b/openair2/UTIL/OSA/osa_stream_eea.c
index 0a044e2e01464de3c71a9e454e5b1c56ef9810c1..8e346631ecb13d04c53eef01e89982c1a5d077c7 100644
--- a/openair2/UTIL/OSA/osa_stream_eea.c
+++ b/openair2/UTIL/OSA/osa_stream_eea.c
@@ -78,7 +78,6 @@ int stream_encrypt_eea1(stream_cipher_t *stream_cipher, uint8_t **out)
   int       n ;
   int       i           = 0;
   uint32_t  zero_bit    = 0;
-  uint32_t  byte_length;
   uint32_t *KS;
   uint32_t  K[4],IV[4];
 
@@ -89,7 +88,6 @@ int stream_encrypt_eea1(stream_cipher_t *stream_cipher, uint8_t **out)
 
   n = ( stream_cipher->blength + 31 ) / 32;
   zero_bit = stream_cipher->blength & 0x7;
-  byte_length = stream_cipher->blength >> 3;
 
   memset(&snow_3g_context, 0, sizeof(snow_3g_context));
   /*Initialisation*/
diff --git a/openair2/UTIL/OTG/otg_kpi.c b/openair2/UTIL/OTG/otg_kpi.c
index 3aa55df05faddbd28535377d3de180c8f58d79d6..877150d892205cff1beeebfa3464c6f9b2dde7ad 100644
--- a/openair2/UTIL/OTG/otg_kpi.c
+++ b/openair2/UTIL/OTG/otg_kpi.c
@@ -61,7 +61,7 @@ void tx_throughput(int src, int dst, int application)
     else if (g_otg->flow_start[src][dst][application] < get_ctime() )
       otg_info->tx_throughput[src][dst][application]=((double)otg_info->tx_num_bytes[src][dst][application] *1000*8)/ ((get_ctime() - g_otg->flow_start[src][dst][application])*1024);
     else 
-      LOG_W("[src %d][dst %d][app %d] flow start time less than the simu time (start %d, duration %d, ctime %d)\n",
+      LOG_W(OTG, "[src %d][dst %d][app %d] flow start time less than the simu time (start %d, duration %d, ctime %d)\n",
 	    src, dst, application,
 	    g_otg->flow_start[src][dst][application],
 	    g_otg->flow_duration[src][dst][application],
@@ -94,7 +94,7 @@ if ((g_otg->flow_start[src][dst][application]+g_otg->flow_duration[src][dst][app
     else if (g_otg->flow_start[src][dst][application] < get_ctime() )
       otg_info->rx_goodput[src][dst][application]=((double)otg_info->rx_num_bytes[src][dst][application] *1000*8)/ ((get_ctime() - g_otg->flow_start[src][dst][application])*1024);
     else 
-      LOG_W("[src %d][dst %d][app %d] flow start time less than the simu time (start %d, duration %d, ctime %d)\n",
+      LOG_W(OTG, "[src %d][dst %d][app %d] flow start time less than the simu time (start %d, duration %d, ctime %d)\n",
 	    src, dst, application,
 	    g_otg->flow_start[src][dst][application],
 	    g_otg->flow_duration[src][dst][application],
diff --git a/openair2/UTIL/OTG/otg_rx.c b/openair2/UTIL/OTG/otg_rx.c
index 8331dd84771703efa2057c450d80c3d284af42dc..3f0d35d2238f70e20a4a55fac0f2e16b0fe630b6 100644
--- a/openair2/UTIL/OTG/otg_rx.c
+++ b/openair2/UTIL/OTG/otg_rx.c
@@ -113,7 +113,7 @@ int otg_rx_pkt(const int dst_instanceP, const int ctime, const char * const buff
       dst_instance = otg_hdr_rx->dst_instance;
 
       if (dst_instance != dst_instanceP) {
-#warning "LG: TODO think about multicast traffic"
+//#warning "LG: TODO think about multicast traffic"
         LOG_W(OTG,"[SRC %d][DST %d] [FLOW_idx %d][APP TYPE %d] RX INFO pkt at time %d: flag 0x %x, seq number %d, tx time %d, size (hdr %d, pdcp %d)  not for dest instance %u\n",
               dst_instanceP);
       }
diff --git a/openair3/GTPV1-U/gtpv1u.h b/openair3/GTPV1-U/gtpv1u.h
index 264fedfe774e36cc74c1548eb4a108ade733b185..e2af712f7be04961f3509ed6018bb9371890df68 100644
--- a/openair3/GTPV1-U/gtpv1u.h
+++ b/openair3/GTPV1-U/gtpv1u.h
@@ -54,7 +54,7 @@
 # define GTPU_ERROR(x, args...)   fprintf(stderr, "[GTPU][E]"x, ##args)
 #endif
 
-#warning "TO BE REFINED"
+//#warning "TO BE REFINED"
 # define GTPU_HEADER_OVERHEAD_MAX 64
 
 uint32_t gtpv1u_new_teid(void);
diff --git a/openair3/GTPV1-U/gtpv1u_eNB.c b/openair3/GTPV1-U/gtpv1u_eNB.c
index ca492469b1b87de8aa1ef02b2773ae2d5e3cacfa..9f2475ef37b204abb3f215d4778bf816b29cdd2c 100644
--- a/openair3/GTPV1-U/gtpv1u_eNB.c
+++ b/openair3/GTPV1-U/gtpv1u_eNB.c
@@ -333,7 +333,7 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req(
             gtpv1u_teid_data_p->eps_bearer_id);
 #endif
 
-#warning "LG eps bearer mapping to DRB id to do (offset -4)"
+//#warning "LG eps bearer mapping to DRB id to do (offset -4)"
       PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gtpv1u_teid_data_p->enb_id, ENB_FLAG_YES,  gtpv1u_teid_data_p->ue_id, 0, 0,gtpv1u_teid_data_p->enb_id);
 
       MSC_LOG_TX_MESSAGE(
@@ -611,7 +611,7 @@ gtpv1u_new_data_req(
   if (bearer_p->state != BEARER_UP) {
     LOG_W(GTPU, "Trying to send data over bearer with state(%u) != BEARER_UP\n",
           bearer_p->state);
-#warning  LG: HACK WHILE WAITING FOR NAS, normally return -1
+//#warning  LG: HACK WHILE WAITING FOR NAS, normally return -1
 
     if (bearer_p->state != BEARER_IN_CONFIG)
       return -1;
@@ -673,7 +673,7 @@ gtpv1u_create_s1u_tunnel(
   teid_t                   s1u_teid             = 0;
   gtpv1u_teid_data_t      *gtpv1u_teid_data_p   = NULL;
   gtpv1u_ue_data_t        *gtpv1u_ue_data_p     = NULL;
-  MessageDef              *message_p            = NULL;
+  //MessageDef              *message_p            = NULL;
   hashtable_rc_t           hash_rc              = HASH_TABLE_KEY_NOT_EXISTS;
   int                      i;
   ebi_t                    eps_bearer_id        = 0;
@@ -996,7 +996,7 @@ void *gtpv1u_eNB_task(void *args)
 {
   int                       rc = 0;
   instance_t                instance;
-  const char               *msg_name_p;
+  //const char               *msg_name_p;
 
   rc = gtpv1u_eNB_init();
   AssertFatal(rc == 0, "gtpv1u_eNB_init Failed");
@@ -1014,7 +1014,7 @@ void *gtpv1u_eNB_task(void *args)
     DevAssert(received_message_p != NULL);
 
     instance = ITTI_MSG_INSTANCE(received_message_p);
-    msg_name_p = ITTI_MSG_NAME(received_message_p);
+    //msg_name_p = ITTI_MSG_NAME(received_message_p);
 
     switch (ITTI_MSG_ID(received_message_p)) {
 
@@ -1081,6 +1081,7 @@ void *gtpv1u_eNB_task(void *args)
             LOG_E(GTPU, "nwGtpv1uGpduMsgNew failed: 0x%x\n", rc);
             MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u",
             		enb_s1u_teid,sgw_s1u_teid,data_req_p->length);
+            (void)enb_s1u_teid; /* avoid gcc warning "set but not used" */
           } else {
             rc = nwGtpv1uProcessUlpReq(gtpv1u_data_g.gtpv1u_stack, &stack_req);
 
diff --git a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c b/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c
index 5308c0c86cd982c662c4ed5596517e9f8ab39be9..2301cfe5dcf50b8a11df5d500ff5ba3fecbe1ce0 100644
--- a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c
+++ b/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c
@@ -630,7 +630,7 @@ nwGtpv1uHandleEchoReq(NW_IN NwGtpv1uStackT *thiz,
 
   bufLen = sizeof(NwGtpv1uIeTv1T)+ ((NwGtpv1uMsgT*)hMsg)->msgLen;
 
-#warning CROUX DIRTY +16, TO BE FIXED!!!
+//#warning CROUX DIRTY +16, TO BE FIXED!!!
   /* the +16 is there because by analyzing memory allocation with some external
    * tool, I saw that there were 6 bytes accessed after bufLen in nwGtpv1uCreateAndSendMsg
    * the value "16" has been chosen arbitrarily, just bigger than 6
@@ -694,7 +694,7 @@ nwGtpv1uInitialize( NW_INOUT NwGtpv1uStackHandleT *hGtpuStackHandle, uint32_t st
   if(thiz) {
     thiz->id    = (NwPtrT)thiz;
     thiz->stackType = stackType;
-    thiz->seq   = (uint16_t) ((uint32_t)thiz) ; // FIXME interesting casts... don't know what this is good for...
+    thiz->seq   = (uint16_t) ((uintptr_t)thiz) ; // FIXME interesting casts... don't know what this is good for...
     RB_INIT(&(thiz->outstandingTxSeqNumMap));
     RB_INIT(&(thiz->outstandingRxSeqNumMap));
     RB_INIT(&(thiz->sessionMap));
diff --git a/openair3/NAS/COMMON/API/NETWORK/nas_message.c b/openair3/NAS/COMMON/API/NETWORK/nas_message.c
index a7e58027650193d48ad5d7e789813d34e4b65bcf..e0face95769a7d76feff71d757ddb6d666de3421 100644
--- a/openair3/NAS/COMMON/API/NETWORK/nas_message.c
+++ b/openair3/NAS/COMMON/API/NETWORK/nas_message.c
@@ -323,7 +323,7 @@ int nas_message_decrypt(
 #if defined(NAS_MME)
       LOG_FUNC_RETURN (TLV_DECODE_MAC_MISMATCH);
 #else
-#warning "added test on integrity algorithm because of SECURITY_MODE_COMMAND not correctly handled in UE (check integrity)"
+//#warning "added test on integrity algorithm because of SECURITY_MODE_COMMAND not correctly handled in UE (check integrity)"
 
       if (emm_security_context->selected_algorithms.integrity !=
           NAS_SECURITY_ALGORITHMS_EIA0) {
@@ -1016,10 +1016,10 @@ static int _nas_message_decrypt(
       stream_cipher.count      = count;
       stream_cipher.bearer     = 0x00; //33.401 section 8.1.1
       stream_cipher.direction  = direction;
-      stream_cipher.message    = src;
+      stream_cipher.message    = (unsigned char *)src;
       /* length in bits */
       stream_cipher.blength    = length << 3;
-      nas_stream_encrypt_eea1(&stream_cipher, dest);
+      nas_stream_encrypt_eea1(&stream_cipher, (unsigned char *)dest);
       /* Decode the first octet (security header type or EPS bearer identity,
        * and protocol discriminator) */
       DECODE_U8(dest, *(uint8_t*)(&header), size);
@@ -1050,10 +1050,10 @@ static int _nas_message_decrypt(
       stream_cipher.count      = count;
       stream_cipher.bearer     = 0x00; //33.401 section 8.1.1
       stream_cipher.direction  = direction;
-      stream_cipher.message    = src;
+      stream_cipher.message    = (unsigned char *)src;
       /* length in bits */
       stream_cipher.blength    = length << 3;
-      nas_stream_encrypt_eea1(&stream_cipher, dest);
+      nas_stream_encrypt_eea1(&stream_cipher, (unsigned char *)dest);
       /* Decode the first octet (security header type or EPS bearer identity,
        * and protocol discriminator) */
       DECODE_U8(dest, *(uint8_t*)(&header), size);
@@ -1178,10 +1178,10 @@ static int _nas_message_encrypt(
       stream_cipher.count      = count;
       stream_cipher.bearer     = 0x00; //33.401 section 8.1.1
       stream_cipher.direction  = direction;
-      stream_cipher.message    = src;
+      stream_cipher.message    = (unsigned char *)src;
       /* length in bits */
       stream_cipher.blength    = length << 3;
-      nas_stream_encrypt_eea1(&stream_cipher, dest);
+      nas_stream_encrypt_eea1(&stream_cipher, (unsigned char *)dest);
 
       LOG_FUNC_RETURN (length);
 
@@ -1209,10 +1209,10 @@ static int _nas_message_encrypt(
       stream_cipher.count      = count;
       stream_cipher.bearer     = 0x00; //33.401 section 8.1.1
       stream_cipher.direction  = direction;
-      stream_cipher.message    = src;
+      stream_cipher.message    = (unsigned char *)src;
       /* length in bits */
       stream_cipher.blength    = length << 3;
-      nas_stream_encrypt_eea2(&stream_cipher, dest);
+      nas_stream_encrypt_eea2(&stream_cipher, (unsigned char *)dest);
 
       LOG_FUNC_RETURN (length);
 
@@ -1344,7 +1344,7 @@ static uint32_t _nas_message_get_mac(
     stream_cipher.count      = count;
     stream_cipher.bearer     = 0x00; //33.401 section 8.1.1
     stream_cipher.direction  = direction;
-    stream_cipher.message    = buffer;
+    stream_cipher.message    = (unsigned char *)buffer;
     /* length in bits */
     stream_cipher.blength    = length << 3;
 
@@ -1390,7 +1390,7 @@ static uint32_t _nas_message_get_mac(
     stream_cipher.count      = count;
     stream_cipher.bearer     = 0x00; //33.401 section 8.1.1
     stream_cipher.direction  = direction;
-    stream_cipher.message    = buffer;
+    stream_cipher.message    = (unsigned char *)buffer;
     /* length in bits */
     stream_cipher.blength    = length << 3;
 
diff --git a/openair3/NAS/COMMON/EMM/MSG/AttachAccept.c b/openair3/NAS/COMMON/EMM/MSG/AttachAccept.c
index 3d800d5c19ef6d2fe9e1e1e687aea2a3cbc588dd..c7e4c3661441200ecc76ffb45d21b360f59f430f 100644
--- a/openair3/NAS/COMMON/EMM/MSG/AttachAccept.c
+++ b/openair3/NAS/COMMON/EMM/MSG/AttachAccept.c
@@ -214,7 +214,7 @@ int encode_attach_accept(attach_accept_msg *attach_accept, uint8_t *buffer, uint
 
   *(buffer + encoded) = (encode_u8_eps_attach_result(&attach_accept->epsattachresult) & 0x0f);
   encoded++;
-#warning "LG TEST override t3412value"
+//#warning "LG TEST override t3412value"
   attach_accept->t3412value.unit = GPRS_TIMER_UNIT_360S;
   attach_accept->t3412value.timervalue = 10;
 
@@ -288,7 +288,7 @@ int encode_attach_accept(attach_accept_msg *attach_accept, uint8_t *buffer, uint
       encoded += encode_result;
   }
 
-#warning "LG TEST override t3402value"
+//#warning "LG TEST override t3402value"
   attach_accept->presencemask |= ATTACH_ACCEPT_T3402_VALUE_PRESENT;
   attach_accept->t3402value.unit = GPRS_TIMER_UNIT_60S;
   attach_accept->t3402value.timervalue = 12;
diff --git a/openair3/NAS/COMMON/IES/MsNetworkFeatureSupport.c b/openair3/NAS/COMMON/IES/MsNetworkFeatureSupport.c
index d8efa5312b765b54c11c4ddb260fcb7c113cfbd0..08fee949a05bc4db8e88fcbda59c79019bcfe2ab 100644
--- a/openair3/NAS/COMMON/IES/MsNetworkFeatureSupport.c
+++ b/openair3/NAS/COMMON/IES/MsNetworkFeatureSupport.c
@@ -54,9 +54,9 @@ int decode_ms_network_feature_support(MsNetworkFeatureSupport *msnetworkfeatures
 }
 int encode_ms_network_feature_support(MsNetworkFeatureSupport *msnetworkfeaturesupport, uint8_t iei, uint8_t *buffer, uint32_t len)
 {
-  uint8_t *lenPtr;
+  //uint8_t *lenPtr;
   uint32_t encoded = 0;
-  int encode_result;
+  //int encode_result;
   /* Checking IEI and pointer */
   CHECK_PDU_POINTER_AND_LENGTH_ENCODER(buffer, MS_NETWORK_FEATURE_SUPPORT_MINIMUM_LENGTH, len);
 #if defined (NAS_DEBUG)
diff --git a/openair3/NAS/COMMON/IES/UeNetworkCapability.c b/openair3/NAS/COMMON/IES/UeNetworkCapability.c
index 41393e7689773f7ef3388d6fddd68b7c68ea1546..902bd1c79cec89bd6bfe18edf3396ec5c776140e 100644
--- a/openair3/NAS/COMMON/IES/UeNetworkCapability.c
+++ b/openair3/NAS/COMMON/IES/UeNetworkCapability.c
@@ -81,7 +81,7 @@ int decode_ue_network_capability(UeNetworkCapability *uenetworkcapability, uint8
         LOG_TRACE(INFO, "uenetworkcapability decoded GPRS\n");
       }
 
-#warning "Force GPRS present if UMTS present"
+//#warning "Force GPRS present if UMTS present"
       uenetworkcapability->gprs_present =1;
     }
   }
@@ -131,7 +131,7 @@ int encode_ue_network_capability(UeNetworkCapability *uenetworkcapability, uint8
   }
 
   if (uenetworkcapability->gprs_present) {
-#warning "Force gea to 0x60"
+//#warning "Force gea to 0x60"
     *(buffer + encoded) = 0x00 | 0x60;
     ////((uenetworkcapability->spare & 0x7) << 5) | // spare coded as zero
     //((uenetworkcapability->csfb  & 0x1) << 4) |
diff --git a/openair3/NAS/TOOLS/ue_data.c b/openair3/NAS/TOOLS/ue_data.c
index 478119acdaf817d27003539104b18f9d26ee71fe..5a463ad094cb8c9e404b421a449aaf1cc9cf792c 100644
--- a/openair3/NAS/TOOLS/ue_data.c
+++ b/openair3/NAS/TOOLS/ue_data.c
@@ -481,7 +481,7 @@ static void _display_emm_data(const emm_nvdata_t* data)
              data->imsi.u.num.digit13,
              data->imsi.u.num.digit14);
     } else {
-      printf("%u%u%u.%u%u%u.%u%u%u%u%u%u%u%u\n",
+      printf("%u%u%u.%u%u%u.%u%u%u%u%u%u%u%u%u\n",
              data->imsi.u.num.digit1,
              data->imsi.u.num.digit2,
              data->imsi.u.num.digit3,
diff --git a/openair3/NAS/UE/API/USIM/usim_api.c b/openair3/NAS/UE/API/USIM/usim_api.c
index 64bc05d0c315b16df1c4cfc00e14401dfc2d42af..51b99033bc5ee00e3eb5ab79d2b47e7eab5c3388 100644
--- a/openair3/NAS/UE/API/USIM/usim_api.c
+++ b/openair3/NAS/UE/API/USIM/usim_api.c
@@ -289,9 +289,9 @@ int usim_api_authenticate(const OctetString* rand_pP, const OctetString* autn_pP
 #define USIM_API_SQN_MS_SIZE  3
 
     for (i = 0; i < USIM_API_SQN_MS_SIZE; i++) {
-#warning "LG:BUG HERE TODO"
+//#warning "LG:BUG HERE TODO"
       sqn_ms[USIM_API_SQNMS_SIZE - i] =
-        ((uint8_t*)(_usim_api_data.sqn_ms))[USIM_API_SQN_MS_SIZE - i];
+        ((uint8_t*)(&_usim_api_data.sqn_ms))[USIM_API_SQN_MS_SIZE - i];
     }
 
     u8 sqnms[USIM_API_SQNMS_SIZE];
diff --git a/openair3/NAS/UE/EMM/EmmStatusHdl.c b/openair3/NAS/UE/EMM/EmmStatusHdl.c
index 85d423fd236070e7591fb6c64e7df5932ba83c02..126b2a94f6a39b0d83841f847c31e2afe54737e3 100755
--- a/openair3/NAS/UE/EMM/EmmStatusHdl.c
+++ b/openair3/NAS/UE/EMM/EmmStatusHdl.c
@@ -130,7 +130,7 @@ int emm_proc_status(unsigned int ueid, int emm_cause)
   emm_sap_t emm_sap;
 
   emm_security_context_t    *sctx = NULL;
-  struct emm_data_context_s *ctx  = NULL;
+  //struct emm_data_context_s *ctx  = NULL;
 
   LOG_TRACE(INFO,"EMM-PROC  - EMM status procedure requested");
 
diff --git a/openair3/NAS/UE/EMM/LowerLayer.c b/openair3/NAS/UE/EMM/LowerLayer.c
index 130fe1bb5d7e199a8b9f013bbe64f0bdc1259458..6e264d2a54571081cbf1e62bb913ade555b4e424 100755
--- a/openair3/NAS/UE/EMM/LowerLayer.c
+++ b/openair3/NAS/UE/EMM/LowerLayer.c
@@ -261,7 +261,7 @@ int lowerlayer_data_req(unsigned int ueid, const OctetString *data)
   int rc;
   emm_sap_t emm_sap;
   emm_security_context_t    *sctx = NULL;
-  struct emm_data_context_s *ctx  = NULL;
+  //struct emm_data_context_s *ctx  = NULL;
 
   emm_sap.primitive = EMMAS_DATA_REQ;
   emm_sap.u.emm_as.u.data.guti = _emm_data.guti;
diff --git a/openair3/NAS/UE/EMM/SAP/emm_fsm.c b/openair3/NAS/UE/EMM/SAP/emm_fsm.c
index 83c5e5f1db7d406d449b4639793770cdf1d7eb96..dc0e1efa28999da7ca71ad9f22929eb9a08238ac 100755
--- a/openair3/NAS/UE/EMM/SAP/emm_fsm.c
+++ b/openair3/NAS/UE/EMM/SAP/emm_fsm.c
@@ -215,7 +215,7 @@ emm_fsm_state_t _emm_fsm_status[EMM_FSM_NB_UE_MAX];
  ***************************************************************************/
 void emm_fsm_initialize(void)
 {
-  int ueid;
+  //int ueid;
   LOG_FUNC_IN;
 
   _emm_fsm_status[0] = EMM_NULL;
diff --git a/openair3/NAS/UE/EMM/SAP/emm_reg.c b/openair3/NAS/UE/EMM/SAP/emm_reg.c
index 7f20b251519b9738a548595066717e96388a804d..b73f75975a71d132caf378a8b57a8172daac3d54 100755
--- a/openair3/NAS/UE/EMM/SAP/emm_reg.c
+++ b/openair3/NAS/UE/EMM/SAP/emm_reg.c
@@ -114,6 +114,9 @@ int emm_reg_send(const emm_reg_t *msg)
   emm_reg_primitive_t primitive = msg->primitive;
   assert( (primitive > _EMMREG_START) && (primitive < _EMMREG_END));
 
+  /* avoid gcc warnings */
+  (void)primitive;
+
   /* Execute the EMM procedure */
   rc = emm_fsm_process(msg);
 
diff --git a/openair3/NAS/UE/ESM/esm_ebr_context.c b/openair3/NAS/UE/ESM/esm_ebr_context.c
index fcf278a2e47216c75627290f01c3308675698578..f56a19b87685aafbdb9124811a6f60d9c874727b 100755
--- a/openair3/NAS/UE/ESM/esm_ebr_context.c
+++ b/openair3/NAS/UE/ESM/esm_ebr_context.c
@@ -114,7 +114,7 @@ int esm_ebr_context_create(
   int                 bid     = 0;
   esm_data_context_t *esm_ctx = NULL;
   esm_pdn_t          *pdn     = NULL;
-  unsigned int        ueid    = 0;
+  //unsigned int        ueid    = 0;
 
   LOG_FUNC_IN;
 
@@ -212,7 +212,7 @@ int esm_ebr_context_create(
         {
            char          *tmp          = NULL;
            char           ipv4_addr[INET_ADDRSTRLEN];
-           char           ipv6_addr[INET6_ADDRSTRLEN];
+           //char           ipv6_addr[INET6_ADDRSTRLEN];
            char          *netmask      = NULL;
            char           broadcast[INET_ADDRSTRLEN];
            struct in_addr in_addr;
@@ -221,7 +221,8 @@ int esm_ebr_context_create(
 
            switch (pdn->type) {
            case NET_PDN_TYPE_IPV4V6:
-             ipv6_addr[0] = pdn->ip_addr[4];
+             //ipv6_addr[0] = pdn->ip_addr[4];
+             /* TODO? */
 
              // etc
            case NET_PDN_TYPE_IPV4:
@@ -283,11 +284,12 @@ int esm_ebr_context_create(
              res = sprintf(command_line,
                            "ifconfig oip1 %s netmask %s broadcast %s up",
                            ipv4_addr, netmask, broadcast);
+             (void)res; /* avoid gcc warning "set but not used" */
              //                            AssertFatal((res > 0) && (res < 128),
              //                                    "error in system command line");
              LOG_TRACE(INFO, "ESM-PROC  - executing %s ",
                        command_line);
-             system(command_line);
+             if (system(command_line)) ; /* TODO: what to do? */
              break;
 
            case NET_PDN_TYPE_IPV6:
@@ -341,7 +343,7 @@ int esm_ebr_context_release(
   esm_pdn_t *pdn = NULL;
   esm_data_context_t *esm_ctx;
 
-  unsigned int ueid = 0;
+  //unsigned int ueid = 0;
 
   LOG_FUNC_IN;
 
diff --git a/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 b/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0
index 3986a6a83b442532ae73ea17a6e1e0053dfc42ca..d5a936c1018b9d3bcc96d06d532c3cddbec911d4 100644
--- a/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0
+++ b/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0
@@ -4,7 +4,7 @@
  
  asn_enc_rval_t OCTET_STRING_encode_aper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *cts, void *sptr, asn_per_outp_t *po) { asn_enc_rval_t er = { 0, 0, 0 }; (void)td; (void)cts; (void)sptr; (void)po; return er; }
  
-+asn_comp_rval_t *  OCTET_STRING_compare(asn_TYPE_descriptor_t *td1, void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) { (void)td1; (void)sptr1; (void)td2; (void)sptr2; return 0; }
++asn_comp_rval_t *  OCTET_STRING_compare(asn_TYPE_descriptor_t *td1, const void *sptr1, asn_TYPE_descriptor_t *td2, const void *sptr2) { (void)td1; (void)sptr1; (void)td2; (void)sptr2; return 0; }
 +
  size_t xer_whitespace_span(const void *chunk_buf, size_t chunk_size) {  (void)chunk_buf; (void)chunk_size; return 0; }
 --- libasn1compiler/asn1c_C.c	2015-12-08 14:39:33.366543533 +0100
@@ -51,9 +51,9 @@
 +  if(HIDE_INNER_DEFS) OUT("_%d", expr->_type_unique_index);
 +    OUT("_compare(asn_TYPE_descriptor_t *td1,\n");
 +  INDENTED(
-+  OUT("\tvoid *structure1,\n");
++  OUT("\tconst void *structure1,\n");
 +  OUT("\tasn_TYPE_descriptor_t *td2,\n");
-+  OUT("\tvoid *structure2) {\n");
++  OUT("\tconst void *structure2) {\n");
 +  OUT("asn_comp_rval_t * res  = NULL;\n");
 +  OUT("%s_%d_inherit_TYPE_descriptor(td1);\n",
 +    p, expr->_type_unique_index);
@@ -142,8 +142,8 @@
 +typedef struct asn_comp_rval_s {
 +  enum COMPARE_ERR_CODE_e err_code;
 +  char                   *name; // e_S1ap_ProtocolIE_ID not available for all ASN1 use (RRC vs S1AP, X2AP)
-+  void                   *structure1;
-+  void                   *structure2;
++  const void             *structure1;
++  const void             *structure2;
 +  struct asn_comp_rval_s *next;
 +} asn_comp_rval_t;
 +
@@ -234,7 +234,7 @@
 +
 +asn_comp_rval_t *
 +BOOLEAN_compare(asn_TYPE_descriptor_t *td1,
-+  void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) {
++  const void *sptr1, asn_TYPE_descriptor_t *td2, const void *sptr2) {
 +  const BOOLEAN_t *st1 = (const BOOLEAN_t *)sptr1;
 +  const BOOLEAN_t *st2 = (const BOOLEAN_t *)sptr2;
 +  asn_comp_rval_t *res = NULL;
@@ -279,9 +279,9 @@
 +
 +typedef asn_comp_rval_t * (type_compare_f)(
 +  struct asn_TYPE_descriptor_s *type_descriptor1,
-+  void *struct_ptr1,
++  const void *struct_ptr1,
 +  struct asn_TYPE_descriptor_s *type_descriptor2,
-+  void *struct_ptr2
++  const void *struct_ptr2
 +);
 +
 +
@@ -299,7 +299,7 @@
  }
 +
 +asn_comp_rval_t *
-+CHOICE_compare(asn_TYPE_descriptor_t *td1, void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2)
++CHOICE_compare(asn_TYPE_descriptor_t *td1, const void *sptr1, asn_TYPE_descriptor_t *td2, const void *sptr2)
 +{
 +  asn_CHOICE_specifics_t *specs1 = (asn_CHOICE_specifics_t *)td1->specifics;
 +  asn_CHOICE_specifics_t *specs2 = (asn_CHOICE_specifics_t *)td2->specifics;
@@ -392,14 +392,13 @@
  }
 --- skeletons/constr_SEQUENCE.c	2015-12-08 14:39:33.346543533 +0100
 +++ skeletons/constr_SEQUENCE.c	2015-12-08 10:39:52.442558000 +0100
-@@ -1761,3 +1761,66 @@
+@@ -1761,3 +1761,65 @@
  
  	_ASN_ENCODED_OK(er);
  }
 +
-+asn_comp_rval_t * SEQUENCE_compare(asn_TYPE_descriptor_t *td1, void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) {
++asn_comp_rval_t * SEQUENCE_compare(asn_TYPE_descriptor_t *td1, const void *sptr1, asn_TYPE_descriptor_t *td2, const void *sptr2) {
 +  int edx;
-+  int ret;
 +  asn_comp_rval_t *res = NULL;
 +  asn_comp_rval_t *res2 = NULL;
 +
@@ -498,7 +497,7 @@
  }
 +
 +asn_comp_rval_t *
-+SET_compare(asn_TYPE_descriptor_t *td1, void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2)
++SET_compare(asn_TYPE_descriptor_t *td1, const void *sptr1, asn_TYPE_descriptor_t *td2, const void *sptr2)
 +{
 +  int edx;
 +  asn_comp_rval_t *res = NULL;
@@ -563,19 +562,18 @@
   * Some handy helpers. *
 --- skeletons/constr_SET_OF.c	2015-12-08 14:39:33.338543533 +0100
 +++ skeletons/constr_SET_OF.c	2015-12-08 10:45:54.466557000 +0100
-@@ -1039,3 +1039,55 @@
+@@ -1039,3 +1039,54 @@
  	rv.consumed = 0;
  	return rv;
  }
 +
 +asn_comp_rval_t *
-+SET_OF_compare(asn_TYPE_descriptor_t *td1, void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2)
++SET_OF_compare(asn_TYPE_descriptor_t *td1, const void *sptr1, asn_TYPE_descriptor_t *td2, const void *sptr2)
 +{
 +  asn_TYPE_member_t *elm1 = td1->elements;
 +  asn_TYPE_member_t *elm2 = td2->elements;
 +  const asn_anonymous_set_ *list1 = _A_CSET_FROM_VOID(sptr1);
 +  const asn_anonymous_set_ *list2 = _A_CSET_FROM_VOID(sptr2);
-+  int ret;
 +  int i;
 +  asn_comp_rval_t *res = NULL;
 +  asn_comp_rval_t *res2 = NULL;
@@ -667,10 +665,10 @@
  }
 +
 +asn_comp_rval_t *
-+ENUMERATED_compare(asn_TYPE_descriptor_t *td1, void *sptr1,
-+                   asn_TYPE_descriptor_t *td2, void *sptr2) {
-+  ENUMERATED_t *st1 = (ENUMERATED_t *)sptr1;
-+  ENUMERATED_t *st2 = (ENUMERATED_t *)sptr2;
++ENUMERATED_compare(asn_TYPE_descriptor_t *td1, const void *sptr1,
++                   asn_TYPE_descriptor_t *td2, const void *sptr2) {
++  const ENUMERATED_t *st1 = (const ENUMERATED_t *)sptr1;
++  const ENUMERATED_t *st2 = (const ENUMERATED_t *)sptr2;
 +  asn_comp_rval_t *res = NULL;
 +
 +  COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res)
@@ -774,10 +772,10 @@
  
  
 +asn_comp_rval_t *
-+INTEGER_compare(asn_TYPE_descriptor_t *td1, void *sptr1,
-+                asn_TYPE_descriptor_t *td2, void *sptr2) {
-+  INTEGER_t *st1 = (INTEGER_t *)sptr1;
-+  INTEGER_t *st2 = (INTEGER_t *)sptr2;
++INTEGER_compare(asn_TYPE_descriptor_t *td1, const void *sptr1,
++                asn_TYPE_descriptor_t *td2, const void *sptr2) {
++  const INTEGER_t *st1 = (const INTEGER_t *)sptr1;
++  const INTEGER_t *st2 = (const INTEGER_t *)sptr2;
 +  asn_comp_rval_t *res = NULL;
 +
 +  COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res)
@@ -857,8 +855,8 @@
  }
 +
 +asn_comp_rval_t *
-+NativeEnumerated_compare(asn_TYPE_descriptor_t *td1, void *sptr1,
-+    asn_TYPE_descriptor_t *td2, void *sptr2) {
++NativeEnumerated_compare(asn_TYPE_descriptor_t *td1, const void *sptr1,
++    asn_TYPE_descriptor_t *td2, const void *sptr2) {
 +  const asn_INTEGER_enum_map_t *a = sptr1;
 +  const asn_INTEGER_enum_map_t *b = sptr2;
 +  asn_comp_rval_t *res = NULL;
@@ -902,8 +900,8 @@
  
 +
 +asn_comp_rval_t *
-+NativeInteger_compare(asn_TYPE_descriptor_t *td1, void *sptr1,
-+                      asn_TYPE_descriptor_t *td2, void *sptr2) {
++NativeInteger_compare(asn_TYPE_descriptor_t *td1, const void *sptr1,
++                      asn_TYPE_descriptor_t *td2, const void *sptr2) {
 +  const long *native1 = (const long *)sptr1;
 +  const long *native2 = (const long *)sptr2;
 +  asn_comp_rval_t *res = NULL;
@@ -945,10 +943,10 @@
  }
  
 +asn_comp_rval_t *
-+NativeReal_compare(asn_TYPE_descriptor_t *td1, void *sptr1,
-+                   asn_TYPE_descriptor_t *td2, void *sptr2) {
-+  REAL_t *st1 = (REAL_t *)sptr1;
-+  REAL_t *st2 = (REAL_t *)sptr2;
++NativeReal_compare(asn_TYPE_descriptor_t *td1, const void *sptr1,
++                   asn_TYPE_descriptor_t *td2, const void *sptr2) {
++  const REAL_t *st1 = (const REAL_t *)sptr1;
++  const REAL_t *st2 = (const REAL_t *)sptr2;
 +  asn_comp_rval_t *res = NULL;
 +
 +  COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res)
@@ -999,8 +997,8 @@
  }
 +
 +asn_comp_rval_t *
-+NULL_compare(asn_TYPE_descriptor_t *td1, void *sptr1,
-+             asn_TYPE_descriptor_t *td2, void *sptr2) {
++NULL_compare(asn_TYPE_descriptor_t *td1, const void *sptr1,
++             asn_TYPE_descriptor_t *td2, const void *sptr2) {
 +
 +  return NULL;
 +}
@@ -1068,9 +1066,9 @@
  
 +asn_comp_rval_t *
 +OCTET_STRING_compare(asn_TYPE_descriptor_t *td1,
-+  void *sptr1, asn_TYPE_descriptor_t *td2, void *sptr2) {
-+  OCTET_STRING_t *st1 = (OCTET_STRING_t *)sptr1;
-+  OCTET_STRING_t *st2 = (OCTET_STRING_t *)sptr2;
++  const void *sptr1, asn_TYPE_descriptor_t *td2, const void *sptr2) {
++  const OCTET_STRING_t *st1 = (const OCTET_STRING_t *)sptr1;
++  const OCTET_STRING_t *st2 = (const OCTET_STRING_t *)sptr2;
 +  asn_comp_rval_t *res = NULL;
 +
 +  COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res)
@@ -1134,10 +1132,10 @@
 +
 +
 +asn_comp_rval_t *
-+REAL_compare(asn_TYPE_descriptor_t *td1, void *sptr1,
-+             asn_TYPE_descriptor_t *td2,  void *sptr2) {
-+  REAL_t *st1 = (REAL_t *)sptr1;
-+  REAL_t *st2 = (REAL_t *)sptr2;
++REAL_compare(asn_TYPE_descriptor_t *td1, const void *sptr1,
++             asn_TYPE_descriptor_t *td2, const void *sptr2) {
++  const REAL_t *st1 = (const REAL_t *)sptr1;
++  const REAL_t *st2 = (const REAL_t *)sptr2;
 +  asn_comp_rval_t *res = NULL;
 +
 +  COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res)
diff --git a/openair3/S1AP/s1ap_eNB_handlers.c b/openair3/S1AP/s1ap_eNB_handlers.c
index 6f0d4128c7174d1b96a819b240038a3e7f2a99e4..fb9722dbc813d0b9f8c8db911445c474904315b5 100644
--- a/openair3/S1AP/s1ap_eNB_handlers.c
+++ b/openair3/S1AP/s1ap_eNB_handlers.c
@@ -859,11 +859,12 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t               assoc_id,
 
     break;
 
-#warning "TODO mapping mme_ue_s1ap_id  enb_ue_s1ap_id?"
+//#warning "TODO mapping mme_ue_s1ap_id  enb_ue_s1ap_id?"
 
   case S1ap_UE_S1AP_IDs_PR_mME_UE_S1AP_ID:
     mme_ue_s1ap_id = ueContextReleaseCommand_p->uE_S1AP_IDs.choice.mME_UE_S1AP_ID;
     S1AP_ERROR("TO DO mapping mme_ue_s1ap_id  enb_ue_s1ap_id");
+    (void)mme_ue_s1ap_id; /* TODO: remove - it's to remove gcc warning about unused var */
 
   case S1ap_UE_S1AP_IDs_PR_NOTHING:
   default:
diff --git a/openair3/S1AP/s1ap_eNB_nas_procedures.c b/openair3/S1AP/s1ap_eNB_nas_procedures.c
index 0cd4c08cb1244d2ab1a53bf3a2a3ccbbe7fecac0..dbe0fef09116f7f61408fc8eab433c44efb15ddf 100644
--- a/openair3/S1AP/s1ap_eNB_nas_procedures.c
+++ b/openair3/S1AP/s1ap_eNB_nas_procedures.c
@@ -191,7 +191,7 @@ int s1ap_eNB_handle_nas_first_req(
    * The cell identity is defined on 28 bits but as we use macro enb id,
    * we have to pad.
    */
-#warning "TODO get cell id from RRC"
+//#warning "TODO get cell id from RRC"
   MACRO_ENB_ID_TO_CELL_IDENTITY(instance_p->eNB_id,
 		  0, // Cell ID
           &initial_ue_message_p->eutran_cgi.cell_ID);
@@ -400,7 +400,7 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_
     s1ap_eNB_instance_p->mnc_digit_length,
     &uplink_NAS_transport_p->eutran_cgi.pLMNidentity);
 
-#warning "TODO get cell id from RRC"
+//#warning "TODO get cell id from RRC"
   MACRO_ENB_ID_TO_CELL_IDENTITY(s1ap_eNB_instance_p->eNB_id,
           0,
           &uplink_NAS_transport_p->eutran_cgi.cell_ID);
diff --git a/openair3/SCTP/sctp_eNB_task.c b/openair3/SCTP/sctp_eNB_task.c
index 357803ac4f8ad112b63a1b90ac626c2179f34417..6812c6bce3f97053ef634ad0f5d70a639b7b8638 100644
--- a/openair3/SCTP/sctp_eNB_task.c
+++ b/openair3/SCTP/sctp_eNB_task.c
@@ -148,7 +148,7 @@ sctp_handle_new_association_req(
   DevAssert(sctp_new_association_req_p != NULL);
 
   /* Create new socket with IPv6 affinity */
-#warning "SCTP may Force IPv4 only, here"
+//#warning "SCTP may Force IPv4 only, here"
 #ifdef NO_VIRTUAL_MACHINE
 
   // in init chunk appears a list of host addresses, IPv4 and IPv4 in an arbitrary (unsorted) order
diff --git a/openair3/SECU/nas_stream_eea1.c b/openair3/SECU/nas_stream_eea1.c
index 4b69ae823161bedb24f477f519fc3316b36c3907..142df9e0dc650a44b77dd59e3878f72a8303064b 100755
--- a/openair3/SECU/nas_stream_eea1.c
+++ b/openair3/SECU/nas_stream_eea1.c
@@ -49,7 +49,7 @@ int nas_stream_encrypt_eea1(nas_stream_cipher_t *stream_cipher, uint8_t *out)
   int       n ;
   int       i           = 0;
   uint32_t  zero_bit    = 0;
-  uint32_t  byte_length;
+  //uint32_t  byte_length;
   uint32_t *KS;
   uint32_t  K[4],IV[4];
 
@@ -60,7 +60,7 @@ int nas_stream_encrypt_eea1(nas_stream_cipher_t *stream_cipher, uint8_t *out)
 
   n = ( stream_cipher->blength + 31 ) / 32;
   zero_bit = stream_cipher->blength & 0x7;
-  byte_length = stream_cipher->blength >> 3;
+  //byte_length = stream_cipher->blength >> 3;
 
   memset(&snow_3g_context, 0, sizeof(snow_3g_context));
   /*Initialisation*/
diff --git a/openair3/SECU/nas_stream_eia2.c b/openair3/SECU/nas_stream_eia2.c
index f1f64dd90aeef7131f06e723e21c118eaa866393..4841dfc90b1d757d62546c31c50a5fe0f50f4e29 100644
--- a/openair3/SECU/nas_stream_eia2.c
+++ b/openair3/SECU/nas_stream_eia2.c
@@ -112,6 +112,7 @@ int nas_stream_encrypt_eia2(nas_stream_cipher_t *stream_cipher, uint8_t out[4])
   cmac_ctx = CMAC_CTX_new();
   ret = CMAC_Init(cmac_ctx, stream_cipher->key, stream_cipher->key_length, cipher, NULL);
   ret = CMAC_Update(cmac_ctx, m, m_length + 8);
+  (void)ret; /* avoid gcc warning "set but not used" */
   CMAC_Final(cmac_ctx, data, &size);
   CMAC_CTX_free(cmac_ctx);
 
diff --git a/openair3/UDP/udp_eNB_task.c b/openair3/UDP/udp_eNB_task.c
index 3e53f9f62f01b66989500f01a446a93a7008ba58..d2a73d9b95ad3abfb0f090fa2ba26f5702bfab80 100644
--- a/openair3/UDP/udp_eNB_task.c
+++ b/openair3/UDP/udp_eNB_task.c
@@ -300,8 +300,8 @@ void *udp_eNB_task(void *args_p)
   int                 nb_events;
   struct epoll_event *events;
   MessageDef         *received_message_p    = NULL;
-  const char         *msg_name = NULL;
-  instance_t          instance  = 0;
+  //const char         *msg_name = NULL;
+  //instance_t          instance  = 0;
   udp_enb_init(NULL);
 
   itti_mark_task_ready(TASK_UDP);
@@ -316,8 +316,8 @@ void *udp_eNB_task(void *args_p)
 
     if (received_message_p != NULL) {
 
-      msg_name = ITTI_MSG_NAME (received_message_p);
-      instance = ITTI_MSG_INSTANCE (received_message_p);
+      //msg_name = ITTI_MSG_NAME (received_message_p);
+      //instance = ITTI_MSG_INSTANCE (received_message_p);
 
       switch (ITTI_MSG_ID(received_message_p)) {
       case UDP_INIT: {
diff --git a/targets/ARCH/COMMON/common_lib.c b/targets/ARCH/COMMON/common_lib.c
index dea02f2bba2b50c7ac421480782a1f547cccb4c9..de78cb80a6558c6222c566e07d469b14cc9716b3 100644
--- a/targets/ARCH/COMMON/common_lib.c
+++ b/targets/ARCH/COMMON/common_lib.c
@@ -147,7 +147,8 @@ int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cf
   int rc;
   //ToDo: EXMIMO harmonization is not complete. That is the reason for this ifdef
   #ifdef EXMIMO
-  device_init(device, openair0_cfg);
+  int device_init(openair0_device *device, openair0_config_t *openair0_cfg);
+  rc = device_init(device, openair0_cfg);
   #else
   rc=load_lib(device, openair0_cfg, NULL,BBU_LOCAL_RADIO_HEAD );
   if ( rc >= 0) {       
diff --git a/targets/ARCH/EXMIMO/DRIVER/eurecom/module_main.c b/targets/ARCH/EXMIMO/DRIVER/eurecom/module_main.c
index 4ef187b07361de2c5722d29e817dd1b7e0db8726..ce699a1b4f021aba64a83a83dbad37bf2cae90ff 100755
--- a/targets/ARCH/EXMIMO/DRIVER/eurecom/module_main.c
+++ b/targets/ARCH/EXMIMO/DRIVER/eurecom/module_main.c
@@ -190,15 +190,13 @@ static int __init openair_init_module( void )
     mmio_length[card] = pci_resource_len  (pdev[card], 0);
     mmio_flags[card]  = pci_resource_flags(pdev[card], 0);
 
-    if (check_mem_region(mmio_start[card],256) < 0) {
+    if (request_mem_region(mmio_start[card],256,"openair_rf") == NULL) {
       printk("[openair][INIT_MODULE][FATAL] : Cannot get memory region 0, aborting\n");
       mmio_start[card] = 0;
       openair_cleanup();
       return -EBUSY;
     } else
-      printk("[openair][INIT_MODULE][INFO] : Reserving memory region 0 : mmio_start = 0x%x\n",(unsigned int)mmio_start[card]);
-
-    request_mem_region(mmio_start[card], 256, "openair_rf");
+      printk("[openair][INIT_MODULE][INFO] : Reserved memory region 0 : mmio_start = 0x%x\n",(unsigned int)mmio_start[card]);
 
     bar[card] = pci_iomap( pdev[card], 0, mmio_length[card] );   // get virtual kernel address for BAR0
 
diff --git a/targets/ARCH/EXMIMO/USERSPACE/LIB/gain_control.h b/targets/ARCH/EXMIMO/USERSPACE/LIB/gain_control.h
index dd48683ad03d162702addcda06f5ff67577cdc09..c71b51550e53f72e3b3c49fed6a27a64afce8475 100644
--- a/targets/ARCH/EXMIMO/USERSPACE/LIB/gain_control.h
+++ b/targets/ARCH/EXMIMO/USERSPACE/LIB/gain_control.h
@@ -30,8 +30,10 @@
 #define TARGET_RX_POWER 50    // Target digital power for the AGC
 #define TARGET_RX_POWER_MAX 53    // Maximum digital power for AGC
 #define TARGET_RX_POWER_MIN 48    // Minimum digital power for AGC
+#ifndef min
 #define min(a,b) (((a)<(b))?(a):(b))
 #define max(a,b) (((a)>(b))?(a):(b))
+#endif
 
 void gain_control_all (unsigned int rx_power_fil_dB, unsigned int card);
 void gain_control (unsigned int rx_power_fil_dB, unsigned int ant, unsigned int card);
diff --git a/targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.h b/targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.h
index ae2ff8a36b08a445d0ab2e3f1169720afde6faf5..0abb27dee281c50aca2e280fd18358ae631513ca 100644
--- a/targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.h
+++ b/targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.h
@@ -98,4 +98,6 @@ unsigned int *openair0_daq_cnt(void);
 // set the TX and RX frequencies (card 0 only for now, to retain USRP compatibility)
 int openair0_set_frequencies(openair0_device* device, openair0_config_t *openair0_cfg,int exmimo_dump_config);
 
+int openair0_set_gains(openair0_device* device, openair0_config_t *openair0_cfg);
+
 #endif
diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c
index 7df20f05c81212c64aa8159d032978f472aad98e..5271ca5d4aa4c1656ed5a0f7d398246d9740b158 100644
--- a/targets/RT/USER/lte-softmodem.c
+++ b/targets/RT/USER/lte-softmodem.c
@@ -394,7 +394,7 @@ struct timespec clock_difftime(struct timespec start, struct timespec end)
     return temp;
 }
 
-void print_difftimes()
+void print_difftimes(void)
 {
 #ifdef DEBUG
     printf("difftimes min = %lu ns ; max = %lu ns\n", min_diff_time.tv_nsec, max_diff_time.tv_nsec);
@@ -1055,7 +1055,7 @@ static void* eNB_thread_tx( void* param )
   static int eNB_thread_tx_status[NUM_ENB_THREADS];
 
   eNB_proc_t *proc = (eNB_proc_t*)param;
-  FILE  *tx_time_file;
+  FILE  *tx_time_file = NULL;
   char tx_time_name[101];
 
   if (opp_enabled == 1) {
@@ -1274,9 +1274,9 @@ static void* eNB_thread_rx( void* param )
 
   eNB_proc_t *proc = (eNB_proc_t*)param;
 
-  FILE  *rx_time_file;
+  FILE  *rx_time_file = NULL;
   char rx_time_name[101];
-  int i;
+  //int i;
 
   if (opp_enabled == 1){
     snprintf(rx_time_name, 100,"/tmp/%s_rx_time_thread_sf_%d", "eNB", proc->subframe);
@@ -1638,6 +1638,11 @@ static void* eNB_thread( void* arg )
   int CC_id=0;	
   struct timespec trx_time0, trx_time1, trx_time2;
 
+  /* avoid gcc warnings */
+  (void)trx_time0;
+  (void)trx_time1;
+  (void)trx_time2;
+
 #ifdef RTAI
   RT_TASK* task = rt_task_init_schmod(nam2num("eNBmain"), 0, 0, 0, SCHED_FIFO, 0xF);
 #else
@@ -1681,7 +1686,7 @@ static void* eNB_thread( void* arg )
 #ifdef RTAI
   printf( "[SCHED][eNB] Started eNB main thread (id %p)\n", task );
 #else
-  printf( "[SCHED][eNB] Started eNB main thread on CPU %d TID %d\n", sched_getcpu(), gettid());
+  printf( "[SCHED][eNB] Started eNB main thread on CPU %d TID %ld\n", sched_getcpu(), gettid());
 #endif
 
 #ifdef HARD_RT
@@ -3225,10 +3230,11 @@ int main( int argc, char **argv )
 
     if (input_fd) {
       printf("Reading in from file to antenna buffer %d\n",0);
-      fread(UE[0]->lte_ue_common_vars.rxdata[0],
-	    sizeof(int32_t),
-	    frame_parms[0]->samples_per_tti*10,
-	    input_fd);
+      if (fread(UE[0]->lte_ue_common_vars.rxdata[0],
+	        sizeof(int32_t),
+	        frame_parms[0]->samples_per_tti*10,
+	        input_fd) != frame_parms[0]->samples_per_tti*10)
+        printf("error reading from file\n");
     }
     //p_exmimo_config->framing.tdd_config = TXRXSWITCH_TESTRX;
   } else {
diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c
index e72b4ec80a39f1434a65e36a97ea96b19138f413..6ab133e5d6bb8e7fc56eec2e21924c94da6d28ee 100644
--- a/targets/RT/USER/lte-ue.c
+++ b/targets/RT/USER/lte-ue.c
@@ -463,7 +463,7 @@ static void *UE_thread_synch(void *arg)
 	 if( UE->mode == rx_dump_frame ){
 	   FILE *fd;
 	   if ((UE->frame_rx&1) == 0) {  // this guarantees SIB1 is present 
-	     if (fd = fopen("rxsig_frame0.dat","w")) {
+	     if ((fd = fopen("rxsig_frame0.dat","w")) != NULL) {
 	       fwrite((void*)&UE->lte_ue_common_vars.rxdata[0][0],
 		      sizeof(int32_t),
 		      10*UE->lte_frame_parms.samples_per_tti,
@@ -607,7 +607,7 @@ static void *UE_thread_synch(void *arg)
 static void *UE_thread_tx(void *arg)
 {
   static int UE_thread_tx_retval;
-  int ret;
+  //int ret;
 
   PHY_VARS_UE *UE = (PHY_VARS_UE*)arg;
 
@@ -1401,14 +1401,14 @@ void *UE_thread(void *arg)
   RT_TASK *task;
 #endif
   // RTIME in, out, diff;
-  int slot=0,frame=0,hw_slot,last_slot,next_slot;
+  int slot=0,frame=0,hw_slot;
   // unsigned int aa;
   int delay_cnt;
   RTIME time_in;
-  int hw_slot_offset=0,rx_offset_mbox=0,mbox_target=0,mbox_current=0;
+  int /* hw_slot_offset=0, */ rx_offset_mbox=0,mbox_target=0,mbox_current=0;
   int diff2;
-  int i, ret;
-  int CC_id,card;
+  int /* i, */ ret;
+  int /* CC_id, */ card;
   volatile unsigned int *DAQ_MBOX = openair0_daq_cnt();
 
   int wait_sync_cnt = 0;
@@ -1688,7 +1688,7 @@ void *UE_thread(void *arg)
         frame++;
       }
     } else if (UE->is_synchronized == 0) { // we are not yet synchronized
-      hw_slot_offset = 0;
+      //hw_slot_offset = 0;
       first_synch = 1;
       slot = 0;
 
diff --git a/targets/RT/USER/rt_wrapper.c b/targets/RT/USER/rt_wrapper.c
index 0242dab3d82a18382e12ac69c31b872e09b8b267..a011cf8dfe83288be1fed972723c29e8d73fc643 100644
--- a/targets/RT/USER/rt_wrapper.c
+++ b/targets/RT/USER/rt_wrapper.c
@@ -38,6 +38,10 @@
 * \warning
 */
 
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
 #include "rt_wrapper.h"
 static int latency_target_fd = -1;
 static int32_t latency_target_value = 0;
@@ -154,6 +158,7 @@ int fill_modeled_runtime_table(uint16_t runtime_phy_rx[29][6],
       runtime_phy_tx[i][j] = cell_processing_dl[j] + platform_processing_dl + user_processing_dl_err[j] + user_processing_dl_a[j]*i+  user_processing_dl_b[j];
     }
   }
+  return 0;
 }
  
 // int runtime_upper_layers[6]; // values for different RBs
diff --git a/targets/SIMU/USER/channel_sim.c b/targets/SIMU/USER/channel_sim.c
index e26129bca656b5bc14fd31fa9e4c36c6bc5c4298..adb1fb92e7a7a75169b9dd837f3653572935568b 100644
--- a/targets/SIMU/USER/channel_sim.c
+++ b/targets/SIMU/USER/channel_sim.c
@@ -97,7 +97,7 @@ void do_DL_sig(double **r_re0,double **r_im0,
   double rx_pwr;
   int32_t rx_pwr2;
   uint32_t i,aa;
-  uint32_t slot_offset,slot_offset_meas;
+  uint32_t slot_offset,slot_offset_meas = 0;
 
   double min_path_loss=-200;
   uint8_t hold_channel=0;
@@ -105,7 +105,7 @@ void do_DL_sig(double **r_re0,double **r_im0,
   uint8_t nb_antennas_rx = eNB2UE[0][0][CC_id]->nb_rx; // number of rx antennas at UE
   uint8_t nb_antennas_tx = eNB2UE[0][0][CC_id]->nb_tx; // number of tx antennas at eNB
 
-  LTE_DL_FRAME_PARMS *fp;
+  //LTE_DL_FRAME_PARMS *fp;
   //  int subframe_sched = ((next_slot>>1) == 0) ? 9 : ((next_slot>>1)-1);
 
 
diff --git a/targets/SIMU/USER/event_handler.c b/targets/SIMU/USER/event_handler.c
index 4072c6bfe776f493f2d4c78de4f5b1e78c622bf4..1f7ecde72e72671d636a5d3b8475cd985a1999e2 100644
--- a/targets/SIMU/USER/event_handler.c
+++ b/targets/SIMU/USER/event_handler.c
@@ -208,15 +208,15 @@ void schedule_events()
 
   a = 5;
 
-  uint16_t *priority[11];//={1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2};
+  //uint16_t *priority[11];//={1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2};
 
 
-  int tab[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX];
+  //int tab[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX];
   Application_Config* application_config;
   application_config = malloc(sizeof(Application_Config));
 
   for(i=0; i<NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX; i++) {
-    tab[i]=i;
+    //tab[i]=i;
     application_config->customized_traffic.aggregation_level[i]=i;
   }
 
@@ -249,7 +249,7 @@ void schedule_events()
   //schedule(READ, MAC_ET, 500, NULL, "");
   //schedule(WRITE, MAC_ET, 100, NULL, "");
   //schedule(READ, TOPO_ET,110,NULL,"",0,0);
-  double b = (double) 45;
+  //double b = (double) 45;
   //schedule(READ, APP_ET,111,NULL,"",0,0);
   //schedule(READ, SYS_ET,112,NULL,"",0,0);
   //schedule(READ, EMU_ET,113,NULL,"",-1,-1);
@@ -1844,7 +1844,6 @@ void update_emu_model(Event_t event)
   printf("\n\n\nA NEW EMU MODEL\n\n\n");
   OAI_Emulation *oai_emulation;
   oai_emulation = get_OAI_emulation();
-  int i=0;
 
   if(event.optype == READ) {
     if(event.key == NULL) {
diff --git a/targets/SIMU/USER/init_lte.c b/targets/SIMU/USER/init_lte.c
index bbb99260ebc0842c65783e9a465bbdfc1c1b9ce6..85900387eb604ba21417998f536a5fac0e4c1cb9 100644
--- a/targets/SIMU/USER/init_lte.c
+++ b/targets/SIMU/USER/init_lte.c
@@ -211,11 +211,11 @@ PHY_VARS_RN* init_lte_RN(LTE_DL_FRAME_PARMS *frame_parms,
 
   if (eMBMS_active_state == multicast_relay) {
     for (i=0; i < 10 ; i++) { // num SF in a frame
-      PHY_vars_RN->dlsch_rn_MCH[i] = new_ue_dlsch(1,1,MAX_TURBO_ITERATIONS_MBSFN,NSOFT,frame_parms->N_RB_DL, 0);
+      PHY_vars_RN->dlsch_rn_MCH[i] = new_ue_dlsch(1,1,NSOFT,MAX_TURBO_ITERATIONS_MBSFN,frame_parms->N_RB_DL, 0);
       LOG_D(PHY,"eNB %d : MCH[%d] %p\n",RN_id,i,PHY_vars_RN->dlsch_rn_MCH[i]);
     }
   } else {
-    PHY_vars_RN->dlsch_rn_MCH[0] = new_ue_dlsch(1,1,MAX_TURBO_ITERATIONS,NSOFT,frame_parms->N_RB_DL, 0);
+    PHY_vars_RN->dlsch_rn_MCH[0] = new_ue_dlsch(1,1,NSOFT,MAX_TURBO_ITERATIONS,frame_parms->N_RB_DL, 0);
     LOG_D(PHY,"eNB %d : MCH[0] %p\n",RN_id,PHY_vars_RN->dlsch_rn_MCH[0]);
   }
 
diff --git a/targets/SIMU/USER/oaisim.c b/targets/SIMU/USER/oaisim.c
index 9e4880906d35b2a9d41162999d09afce48874b7a..d09f61f06a738872df3ffb6c99db8560b6f966c9 100644
--- a/targets/SIMU/USER/oaisim.c
+++ b/targets/SIMU/USER/oaisim.c
@@ -458,6 +458,7 @@ l2l1_task (void *args_p)
   char *xargv[1];
   //#endif
 
+#undef PRINT_STATS /* this undef is to avoid gcc warnings */
 #define PRINT_STATS
 #ifdef PRINT_STATS
   int len;
@@ -530,19 +531,23 @@ l2l1_task (void *args_p)
 
   if(abstraction_flag==0) {
     for (UE_inst=0; UE_inst<NB_UE_INST; UE_inst++) {
-      sprintf(UE_stats_th_filename,"UE_stats_th%d_tx%d.txt",UE_inst,oai_emulation.info.transmission_mode);
+      /* TODO: transmission_mode is defined per CC, we set 0 for now */
+      sprintf(UE_stats_th_filename,"UE_stats_th%d_tx%d.txt",UE_inst,oai_emulation.info.transmission_mode[0]);
       UE_stats_th[UE_inst] = fopen (UE_stats_th_filename, "w");
     }
 
-    sprintf(eNB_stats_th_filename,"eNB_stats_th_tx%d.txt",oai_emulation.info.transmission_mode);
+    /* TODO: transmission_mode is defined per CC, we set 0 for now */
+    sprintf(eNB_stats_th_filename,"eNB_stats_th_tx%d.txt",oai_emulation.info.transmission_mode[0]);
     eNB_avg_thr = fopen (eNB_stats_th_filename, "w");
   } else {
     for (UE_inst=0; UE_inst<NB_UE_INST; UE_inst++) {
-      sprintf(UE_stats_th_filename,"UE_stats_abs_th%d_tx%d.txt",UE_inst,oai_emulation.info.transmission_mode);
+      /* TODO: transmission_mode is defined per CC, we set 0 for now */
+      sprintf(UE_stats_th_filename,"UE_stats_abs_th%d_tx%d.txt",UE_inst,oai_emulation.info.transmission_mode[0]);
       UE_stats_th[UE_inst] = fopen (UE_stats_th_filename, "w");
     }
 
-    sprintf(eNB_stats_th_filename,"eNB_stats_abs_th_tx%d.txt",oai_emulation.info.transmission_mode);
+    /* TODO: transmission_mode is defined per CC, we set 0 for now */
+    sprintf(eNB_stats_th_filename,"eNB_stats_abs_th_tx%d.txt",oai_emulation.info.transmission_mode[0]);
     eNB_avg_thr = fopen (eNB_stats_th_filename, "w");
   }
 
@@ -977,7 +982,7 @@ l2l1_task (void *args_p)
 
           for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++)
             for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
-#warning figure out what to do with UE frame_parms during initial_sync
+//#warning figure out what to do with UE frame_parms during initial_sync
               do_DL_sig (r_re0,
                          r_im0,
                          r_re,
@@ -1000,7 +1005,7 @@ l2l1_task (void *args_p)
           start_meas (&ul_chan_stats);
 
           for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
-#warning figure out what to do with UE frame_parms during initial_sync
+//#warning figure out what to do with UE frame_parms during initial_sync
             do_UL_sig (r_re0, r_im0, r_re, r_im, s_re, s_im, UE2eNB,
                        enb_data, ue_data, next_slot,
                        abstraction_flag,
@@ -1034,7 +1039,7 @@ l2l1_task (void *args_p)
 
             for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++)
               for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
-#warning  check dimensions of r_reN,r_imN for multiple CCs
+//#warning  check dimensions of r_reN,r_imN for multiple CCs
                 do_DL_sig (r_re0,
                            r_im0,
                            r_re,
@@ -1061,7 +1066,7 @@ l2l1_task (void *args_p)
             start_meas (&ul_chan_stats);
 
             for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
-#warning  check dimensions of r_reN,r_imN for multiple CCs
+//#warning  check dimensions of r_reN,r_imN for multiple CCs
               do_UL_sig (r_re0,
                          r_im0,
                          r_re,
@@ -1770,6 +1775,7 @@ print_opp_meas (void)
 
 }
 
+#if !defined(ENABLE_ITTI)
 static void *
 sigh (void *arg)
 {
@@ -1805,6 +1811,7 @@ sigh (void *arg)
 
   pthread_exit (NULL);
 }
+#endif /* !defined(ENABLE_ITTI) */
 
 void
 oai_shutdown (void)
diff --git a/targets/SIMU/USER/oaisim_functions.c b/targets/SIMU/USER/oaisim_functions.c
index 014a9e39d02aa2d3192095c00ae1efd80a9cd1a7..72153c3ee7a7a351f8d572213cf5a2eb7193d714 100644
--- a/targets/SIMU/USER/oaisim_functions.c
+++ b/targets/SIMU/USER/oaisim_functions.c
@@ -957,7 +957,7 @@ void init_openair1(void)
   openair_daq_vars.rx_gain_mode = DAQ_AGC_ON;
 
   openair_daq_vars.dlsch_transmission_mode = oai_emulation.info.transmission_mode[0];
-#warning "NN->FK: OAI EMU channel abstraction does not work for MCS higher than"
+//#warning "NN->FK: OAI EMU channel abstraction does not work for MCS higher than"
   openair_daq_vars.target_ue_dl_mcs = cmin(target_dl_mcs,16);
   openair_daq_vars.target_ue_ul_mcs = target_ul_mcs;
   openair_daq_vars.ue_dl_rb_alloc=0x1fff;
@@ -1049,7 +1049,7 @@ void init_openair2(void)
   module_id_t enb_id;
   module_id_t UE_id;
   int CC_id;
-#warning "eNB index is hard coded to zero"
+//#warning "eNB index is hard coded to zero"
 
   for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++)
     l2_init (&PHY_vars_eNB_g[0][CC_id]->lte_frame_parms,
@@ -1270,10 +1270,10 @@ void update_ocm()
           LOG_I(OCM,"Path loss (CCid %d) between eNB %d at (%f,%f) and UE %d at (%f,%f) is %f, angle %f\n",
                 CC_id,eNB_id,enb_data[eNB_id]->x,enb_data[eNB_id]->y,UE_id,ue_data[UE_id]->x,ue_data[UE_id]->y,
                 eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB, eNB2UE[eNB_id][UE_id][CC_id]->aoa);
-          double dx, dy, distance;
-          dx = enb_data[eNB_id]->x - ue_data[UE_id]->x;
-          dy = enb_data[eNB_id]->y - ue_data[UE_id]->y;
-          distance = sqrt(dx * dx + dy * dy);
+          //double dx, dy, distance;
+          //dx = enb_data[eNB_id]->x - ue_data[UE_id]->x;
+          //dy = enb_data[eNB_id]->y - ue_data[UE_id]->y;
+          //distance = sqrt(dx * dx + dy * dy);
           /*LOG_D(LOCALIZE, " OCM distance between eNB %d at (%f,%f) and UE %d at (%f,%f) is %f \n",
                   eNB_id, enb_data[eNB_id]->x,enb_data[eNB_id]->y,
                   UE_id, ue_data[UE_id]->x,ue_data[UE_id]->y,
@@ -1313,7 +1313,7 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
 
 #if defined(USER_MODE) && defined(OAI_EMU)
 
-  int rrc_state=0; 
+  //int rrc_state=0;
 
   if (oai_emulation.info.otg_enabled ==1 ) {