Added option to force 32bit compilation (useful for debug). Fixed various warnings when compiling in a 32 bit arch.

master
Pedro Alvarez 5 years ago committed by Andre Puschmann
parent a96a7fe20a
commit 6d4303cd94

@ -87,6 +87,8 @@ option(USE_LTE_RATES "Use standard LTE sampling rates" OFF)
option(USE_GLIBC_IPV6 "Use glibc's own ipv6.h" ON) option(USE_GLIBC_IPV6 "Use glibc's own ipv6.h" ON)
option(USE_MKL "Use MKL instead of fftw" OFF) option(USE_MKL "Use MKL instead of fftw" OFF)
option(FORCE_32BIT "Add flags to force 32 bit compilation" OFF)
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64") if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
set(GCC_ARCH armv8-a CACHE STRING "GCC compile for specific architecture.") set(GCC_ARCH armv8-a CACHE STRING "GCC compile for specific architecture.")
message(STATUS "Detected aarch64 processor") message(STATUS "Detected aarch64 processor")
@ -329,6 +331,13 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if(NOT WIN32) if(NOT WIN32)
ADD_CXX_COMPILER_FLAG_IF_AVAILABLE(-fvisibility=hidden HAVE_VISIBILITY_HIDDEN_CXX) ADD_CXX_COMPILER_FLAG_IF_AVAILABLE(-fvisibility=hidden HAVE_VISIBILITY_HIDDEN_CXX)
endif(NOT WIN32) endif(NOT WIN32)
if(FORCE_32BIT)
ADD_C_COMPILER_FLAG_IF_AVAILABLE("-m32" HAVE_WNO_UNUSED_BUT_SET_VARIABLE)
ADD_CXX_COMPILER_FLAG_IF_AVAILABLE("-m32" HAVE_WNO_UNUSED_BUT_SET_VARIABLE)
set(CMAKE_SHARED_LINKER_FLAGS "-m32")
endif(FORCE_32BIT)
endif(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") endif(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
ADD_C_COMPILER_FLAG_IF_AVAILABLE("-Werror=incompatible-pointer-types" HAVE_ERROR_INCOMPATIBLE) ADD_C_COMPILER_FLAG_IF_AVAILABLE("-Werror=incompatible-pointer-types" HAVE_ERROR_INCOMPATIBLE)

@ -260,7 +260,7 @@ private:
* @tparam T * @tparam T
* @tparam Nthres number of elements T that can be stored in the stack * @tparam Nthres number of elements T that can be stored in the stack
*/ */
template <class T, uint32_t Nthres = ceil_frac(16lu, sizeof(T))> template <class T, uint32_t Nthres = ceil_frac(size_t(16), sizeof(T))>
class ext_array class ext_array
{ {
public: public:

@ -625,7 +625,7 @@ int rf_zmq_recv_with_time_multi(void* h,
// Check available buffer size // Check available buffer size
if (nbytes > ZMQ_MAX_BUFFER_SIZE) { if (nbytes > ZMQ_MAX_BUFFER_SIZE) {
fprintf(stderr, fprintf(stderr,
"[zmq] Error: Trying to receive %d B but buffer is only %ld B at channel %d.\n", "[zmq] Error: Trying to receive %d B but buffer is only %zu B at channel %d.\n",
nbytes, nbytes,
ZMQ_MAX_BUFFER_SIZE, ZMQ_MAX_BUFFER_SIZE,
0); 0);
@ -762,7 +762,7 @@ int rf_zmq_send_timed_multi(void* h,
uint32_t nbytes_baseband = NSAMPLES2NBYTES(nsamples_baseband); uint32_t nbytes_baseband = NSAMPLES2NBYTES(nsamples_baseband);
if (nbytes_baseband > ZMQ_MAX_BUFFER_SIZE) { if (nbytes_baseband > ZMQ_MAX_BUFFER_SIZE) {
fprintf(stderr, "Error: trying to transmit too many samples (%d > %ld).\n", nbytes, ZMQ_MAX_BUFFER_SIZE); fprintf(stderr, "Error: trying to transmit too many samples (%d > %zu).\n", nbytes, ZMQ_MAX_BUFFER_SIZE);
goto clean_exit; goto clean_exit;
} }
@ -790,7 +790,7 @@ int rf_zmq_send_timed_multi(void* h,
if (num_tx_gap_samples < 0) { if (num_tx_gap_samples < 0) {
fprintf(stderr, fprintf(stderr,
"[zmq] Error: tx time is %.3f ms in the past (%ld < %ld)\n", "[zmq] Error: tx time is %.3f ms in the past (%" PRIu64 " < %" PRIu64 ")\n",
-1000.0 * num_tx_gap_samples / handler->base_srate, -1000.0 * num_tx_gap_samples / handler->base_srate,
tx_ts, tx_ts,
handler->transmitter[0].nsamples); handler->transmitter[0].nsamples);

@ -20,7 +20,7 @@
*/ */
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <inttypes.h>
#include "srslte/config.h" #include "srslte/config.h"
#include "srslte/phy/rf/rf.h" #include "srslte/phy/rf/rf.h"

@ -67,7 +67,7 @@ static void* rf_zmq_async_rx_thread(void* h)
} else if (n > ZMQ_MAX_BUFFER_SIZE) { } else if (n > ZMQ_MAX_BUFFER_SIZE) {
fprintf(stderr, fprintf(stderr,
"[zmq] Error: receiver expected <= %ld bytes and received %d at channel %d.\n", "[zmq] Error: receiver expected <= %zu bytes and received %d at channel %d.\n",
ZMQ_MAX_BUFFER_SIZE, ZMQ_MAX_BUFFER_SIZE,
n, n,
0); 0);

@ -567,7 +567,7 @@ public:
if (lcid == 0) { if (lcid == 0) {
if (mac_msg_dl.new_subh()) { if (mac_msg_dl.new_subh()) {
if (mac_msg_dl.get()->set_con_res_id(conres_id)) { if (mac_msg_dl.get()->set_con_res_id(conres_id)) {
log.info("CE: Added Contention Resolution ID=0x%lx\n", conres_id); log.info("CE: Added Contention Resolution ID=0x%" PRIx64 "\n", conres_id);
} else { } else {
log.error("CE: Setting Contention Resolution ID CE\n"); log.error("CE: Setting Contention Resolution ID CE\n");
} }

Loading…
Cancel
Save