--- a/src/core/model/int64x64.cc Mon Sep 29 22:07:14 2014 +0100 +++ a/src/core/model/int64x64.cc Thu Oct 02 11:01:24 2014 -0700 @@ -35,7 +35,7 @@ int64_t hi = absVal.GetHigh (); // Save stream format flags - const std::streamsize precision = os.precision (); + const std::size_t precision = static_cast (os.precision ()); std::ios_base::fmtflags ff = os.flags (); const bool floatfield = os.flags () & std::ios_base::floatfield; os << std::setw (1) << std::noshowpos; @@ -47,7 +47,7 @@ int64x64_t low(0, absVal.GetLow ()); - int places = 0; // Number of decimal places printed so far + std::size_t places = 0; // Number of decimal places printed so far bool more = true; // Should we print more digits? #define HEXHILOW(hi, lo) \ --- a/src/fd-net-device/model/fd-net-device.cc Mon Sep 29 22:07:14 2014 +0100 +++ a/src/fd-net-device/model/fd-net-device.cc Thu Oct 02 11:01:24 2014 -0700 @@ -288,7 +288,7 @@ /// instead of memcpy to add the PI header. /// It might be faster in this case to use memmove and avoid the extra mallocs. static void -AddPIHeader (uint8_t *&buf, ssize_t &len) +AddPIHeader (uint8_t *&buf, size_t &len) { // Synthesize PI header for our friend the kernel uint8_t *buf2 = (uint8_t*)malloc (len + 4); @@ -526,7 +526,7 @@ NS_ASSERT_MSG (packet->GetSize () <= m_mtu, "FdNetDevice::SendFrom(): Packet too big " << packet->GetSize ()); - ssize_t len = (ssize_t) packet->GetSize (); + size_t len = (size_t)(packet->GetSize ()); uint8_t *buffer = (uint8_t*)malloc (len); packet->CopyData (buffer, len); @@ -539,7 +539,7 @@ ssize_t written = write (m_fd, buffer, len); free (buffer); - if (written == -1 || written != len) + if (written < 0 || (size_t)(written) != len) { m_macTxDropTrace (packet); return false; --- a/src/lte/model/lte-ue-phy.cc Mon Sep 29 22:07:14 2014 +0100 +++ a/src/lte/model/lte-ue-phy.cc Thu Oct 02 11:01:24 2014 -0700 @@ -728,7 +728,6 @@ { NS_LOG_FUNCTION (this); - // apply transmission mode gain NS_ASSERT (m_transmissionMode < m_txModeGain.size ()); SpectrumValue newSinr = sinr; @@ -742,12 +741,12 @@ { cqi = m_amc->CreateCqiFeedbacks (newSinr, m_dlBandwidth); - int nLayer = TransmissionModesLayers::TxMode2LayerNum (m_transmissionMode); - int nbSubChannels = cqi.size (); + uint8_t nLayer = TransmissionModesLayers::TxMode2LayerNum (m_transmissionMode); + std::size_t nbSubChannels = cqi.size (); double cqiSum = 0.0; - int activeSubChannels = 0; + uint32_t activeSubChannels = 0; // average the CQIs of the different RBs - for (int i = 0; i < nbSubChannels; i++) + for (uint32_t i = 0; i < nbSubChannels; i++) { if (cqi.at (i) != -1) { @@ -761,7 +760,7 @@ dlcqi.m_cqiType = CqiListElement_s::P10; // Peridic CQI using PUCCH wideband NS_ASSERT_MSG (nLayer > 0, " nLayer negative"); NS_ASSERT_MSG (nLayer < 3, " nLayer limit is 2s"); - for (int i = 0; i < nLayer; i++) + for (uint8_t i = 0; i < nLayer; i++) { if (activeSubChannels > 0) { @@ -780,14 +779,14 @@ else if (Simulator::Now () > m_a30CqiLast + m_a30CqiPeriocity) { cqi = m_amc->CreateCqiFeedbacks (newSinr, GetRbgSize ()); - int nLayer = TransmissionModesLayers::TxMode2LayerNum (m_transmissionMode); - int nbSubChannels = cqi.size (); - int rbgSize = GetRbgSize (); + uint8_t nLayer = TransmissionModesLayers::TxMode2LayerNum (m_transmissionMode); + std::size_t nbSubChannels = cqi.size (); + uint8_t rbgSize = GetRbgSize (); double cqiSum = 0.0; - int cqiNum = 0; + uint8_t cqiNum = 0; SbMeasResult_s rbgMeas; - //NS_LOG_DEBUG (this << " Create A30 CQI feedback, RBG " << rbgSize << " cqiNum " << nbSubChannels << " band " << (uint16_t)m_dlBandwidth); - for (int i = 0; i < nbSubChannels; i++) + //NS_LOG_DEBUG (this << " Create A30 CQI feedback, RBG " << (uint16_t) rbgSize << " cqiNum " << nbSubChannels << " band " << (uint16_t)m_dlBandwidth); + for (uint32_t i = 0; i < nbSubChannels; i++) { if (cqi.at (i) != -1) { @@ -801,7 +800,7 @@ //NS_LOG_DEBUG (this << " RBG CQI " << (uint16_t) cqiSum / rbgSize); HigherLayerSelected_s hlCqi; hlCqi.m_sbPmi = 0; // not yet used - for (int i = 0; i < nLayer; i++) + for (uint8_t i = 0; i < nLayer; i++) { hlCqi.m_sbCqi.push_back ((uint16_t) cqiSum / rbgSize); } --- a/src/stats/model/basic-data-calculators.h Mon Sep 29 22:07:14 2014 +0100 +++ a/src/stats/model/basic-data-calculators.h Thu Oct 02 11:01:24 2014 -0700 @@ -160,11 +160,11 @@ } else { - if (i < m_min) + if (i - m_min < 0) { m_min = i; } - if (i > m_max) + if (i - m_max > 0) { m_max = i; } --- a/wscript Mon Sep 29 22:07:14 2014 +0100 +++ a/wscript Thu Oct 02 11:01:24 2014 -0700 @@ -330,7 +330,7 @@ if conf.check_compilation_flag('-march=native'): env.append_value('CXXFLAGS', '-march=native') env.append_value('CXXFLAGS', '-fstrict-overflow') - if conf.env['CC_VERSION'] == cc_version_warn_strict_overflow: + if conf.env['CC_VERSION'] >= cc_version_warn_strict_overflow: env.append_value('CXXFLAGS', '-Wstrict-overflow=5') if sys.platform == 'win32':