mirror of
https://github.com/EttusResearch/uhd.git
synced 2026-10-25 17:36:10 +00:00
lib: Fix compiler warnings with GCC 16 / Python 3.14
sim_find.cpp: Python 3.14's pyconfig.h redefines _POSIX_C_SOURCE and _XOPEN_SOURCE to older values, but only if they haven't been defined yet. Moving <Python.h> to be the first include (before any system header that pulls in features.h via <string>) prevents the -Wmacro-redefinition warnings that become errors under -Werror. usrprio_rpc_client.cpp: Value-initialize usrprio_device_info to silence -Wmaybe-uninitialized on the interface_num member, caught by GCC 16.
This commit is contained in:
parent
632f9927e5
commit
1b0c95e31a
@ -53,7 +53,7 @@ nirio_status usrprio_rpc_client::niusrprio_enumerate(NIUSRPRIO_ENUMERATE_ARGS)
|
|||||||
if (nirio_status_not_fatal(status) && vtr_size > 0) {
|
if (nirio_status_not_fatal(status) && vtr_size > 0) {
|
||||||
device_info_vtr.resize(vtr_size);
|
device_info_vtr.resize(vtr_size);
|
||||||
for (size_t i = 0; i < (size_t)vtr_size; i++) {
|
for (size_t i = 0; i < (size_t)vtr_size; i++) {
|
||||||
usrprio_device_info info;
|
usrprio_device_info info{};
|
||||||
try {
|
try {
|
||||||
out_args >> info;
|
out_args >> info;
|
||||||
} catch (std::exception&) {
|
} catch (std::exception&) {
|
||||||
|
|||||||
@ -4,13 +4,17 @@
|
|||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
//
|
//
|
||||||
|
|
||||||
|
// Python.h must be included before any system header that pulls in features.h,
|
||||||
|
// otherwise Python 3.14+ pyconfig.h will attempt to redefine _POSIX_C_SOURCE
|
||||||
|
// and _XOPEN_SOURCE after glibc has already set them to newer values.
|
||||||
|
// Need this import because pybind11 doesn't have an equivalent to Py_IsInitialized()
|
||||||
|
#include <Python.h>
|
||||||
|
|
||||||
#include "mpmd_devices.hpp"
|
#include "mpmd_devices.hpp"
|
||||||
#include "mpmd_impl.hpp"
|
#include "mpmd_impl.hpp"
|
||||||
#include <uhd/device.hpp>
|
#include <uhd/device.hpp>
|
||||||
#include <uhd/utils/static.hpp>
|
#include <uhd/utils/static.hpp>
|
||||||
#include <uhdlib/rfnoc/rfnoc_device.hpp>
|
#include <uhdlib/rfnoc/rfnoc_device.hpp>
|
||||||
// Need this import because pybind doesn't have an equivalent to Py_IsInitialized()
|
|
||||||
#include <Python.h>
|
|
||||||
#include <pybind11/embed.h>
|
#include <pybind11/embed.h>
|
||||||
#include <pybind11/pybind11.h>
|
#include <pybind11/pybind11.h>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user