aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorNicholas Corgan <nick.corgan@ettus.com>2015-03-27 09:35:29 -0700
committerNicholas Corgan <nick.corgan@ettus.com>2015-03-27 09:35:29 -0700
commit1200721b696751edaceb70a332861f84fb8c16d5 (patch)
tree15a56b1a54b5b059779d00115a9f58af991035ac /host/include
parenta712b026a806cd1c106d62fd9278536fcc0a8b62 (diff)
downloaduhd-1200721b696751edaceb70a332861f84fb8c16d5.tar.gz
uhd-1200721b696751edaceb70a332861f84fb8c16d5.tar.bz2
uhd-1200721b696751edaceb70a332861f84fb8c16d5.zip
Warning fixes
* CMake now not applying C++ flags to C files * GCC 4.4: anti-aliasing rules * MSVC: narrowing, differences in subclass function parameters * Clang: uninitialized variables
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/transport/nirio/nirio_fifo.ipp15
-rw-r--r--host/include/uhd/transport/nirio/nirio_resource_manager.h6
-rw-r--r--host/include/uhd/usrp_clock/multi_usrp_clock.hpp2
3 files changed, 14 insertions, 9 deletions
diff --git a/host/include/uhd/transport/nirio/nirio_fifo.ipp b/host/include/uhd/transport/nirio/nirio_fifo.ipp
index ca6486e30..72a337ac2 100644
--- a/host/include/uhd/transport/nirio/nirio_fifo.ipp
+++ b/host/include/uhd/transport/nirio/nirio_fifo.ipp
@@ -1,5 +1,5 @@
//
-// Copyright 2013-2014 Ettus Research LLC
+// Copyright 2013-2015 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -15,9 +15,11 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
-#ifdef __clang__
- #pragma GCC diagnostic push ignored "-Wmissing-field-initializers"
-#elif defined(__GNUC__)
+// "push" and "pop" introduced in GCC 4.6; works with all clang
+#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 3) && (__GNUC_MINOR__ > 5)
+ #pragma GCC diagnostic push
+#endif
+#if defined(__clang__) || defined(__GNUC__)
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#endif
@@ -40,7 +42,8 @@ nirio_fifo<data_t>::nirio_fifo(
{
nirio_status status = 0;
nirio_status_chain(_riok_proxy_ptr->set_attribute(RIO_ADDRESS_SPACE, BUS_INTERFACE), status);
- uint32_t base_addr, addr_space_word;
+ uint32_t base_addr = 0;
+ uint32_t addr_space_word = 0;
nirio_status_chain(_riok_proxy_ptr->peek(0x1C, base_addr), status);
nirio_status_chain(_riok_proxy_ptr->peek(0xC, addr_space_word), status);
_dma_base_addr = base_addr + (_fifo_channel * (1<<((addr_space_word>>16)&0xF)));
@@ -375,6 +378,6 @@ inline datatype_info_t nirio_fifo<uint64_t>::_get_datatype_info()
return datatype_info_t(RIO_SCALAR_TYPE_UQ, 8);
}
-#ifdef __GNUC__
+#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 3) && (__GNUC_MINOR__ > 5)
#pragma GCC diagnostic pop
#endif
diff --git a/host/include/uhd/transport/nirio/nirio_resource_manager.h b/host/include/uhd/transport/nirio/nirio_resource_manager.h
index c71f1c8aa..301b588c7 100644
--- a/host/include/uhd/transport/nirio/nirio_resource_manager.h
+++ b/host/include/uhd/transport/nirio/nirio_resource_manager.h
@@ -1,5 +1,5 @@
//
-// Copyright 2013 Ettus Research LLC
+// Copyright 2013,2015 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -78,7 +78,7 @@ public:
}
if (fifo->get_channel() != fifo_info_ptr->channel) return NiRio_Status_InvalidParameter;
- if (fifo->get_scalar_type() != fifo_info_ptr->scalar_type) return NiRio_Status_InvalidParameter;
+ if (nirio_scalar_type_t(fifo->get_scalar_type()) != fifo_info_ptr->scalar_type) return NiRio_Status_InvalidParameter;
return NiRio_Status_Success;
}
@@ -94,7 +94,7 @@ public:
}
if (fifo->get_channel() != fifo_info_ptr->channel) return NiRio_Status_InvalidParameter;
- if (fifo->get_scalar_type() != fifo_info_ptr->scalar_type) return NiRio_Status_InvalidParameter;
+ if (nirio_scalar_type_t(fifo->get_scalar_type()) != fifo_info_ptr->scalar_type) return NiRio_Status_InvalidParameter;
return NiRio_Status_Success;
}
diff --git a/host/include/uhd/usrp_clock/multi_usrp_clock.hpp b/host/include/uhd/usrp_clock/multi_usrp_clock.hpp
index 0b50b32ae..48d433d71 100644
--- a/host/include/uhd/usrp_clock/multi_usrp_clock.hpp
+++ b/host/include/uhd/usrp_clock/multi_usrp_clock.hpp
@@ -57,6 +57,8 @@ class UHD_API multi_usrp_clock : boost::noncopyable {
public:
typedef boost::shared_ptr<multi_usrp_clock> sptr;
+ virtual ~multi_usrp_clock(void) = 0;
+
/*!
* Make a new Multi-USRP-Clock from the given device address.
* \param dev_addr the device address