-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[windows] Swig is building a bad "SoapySDRPYTHON_wrap.cxx" causing C4101 warning in MSVC for unreferenced local variable #449
Comments
As I am not enough familiar with any of these tools, I am not able to help further than finding the statements within the Swig generated file, using bash: grep -n --color=always -H -R -i -E "catch \(const Swig::DirectorException \&e\)" ./ How is this generated by Swig? |
We should maybe compile wirh |
Does this work? Add in https://github.com/pothosware/SoapySDR/blob/master/swig/python/CMakeLists.txt#L110
|
Hi Christian, As a quick comment, I'm not a big fan of having to "hide" compiler warnings. They are there for a reason, and that reason usually breaks eventually. In addition, users should not have to resort to tweak compiler warnings. As of today there are already 2 of those in use; Also, the fix for above may be just finding and replacing them in:
BTW. I've also started looking into building/installing from MSYS/MINGW64. As out-of-the-box it runs and detects after also installing "recommended" |
I'm also seeing Excluding the |
I'm looking at this again... First of all I want to ask: Is there a reason why we are using compiler From: #C++11 is a required language feature for this project
set(CMAKE_CXX_STANDARD 11) I managed to rid all the C4101 by using the change in OP and applying compiler to The question is also if this is an unused -Wunused-const-variable
-Wunused-variable It may be also be possible to use: <PropertyGroup>
<NoWarn>$(NoWarn);MSB3253</NoWarn>
</PropertyGroup> See: Also, I don't think is a good idea to reduce (from
https://learn.microsoft.com/en-us/cpp/build/reference/compiler-option-warning-level?view=msvc-170 |
Compiling SoapySDR on windows, we get 1000's of warning error for a silly error, due to not sanitizing a
catch()
statement, in the build file:SoapySDRPYTHON_wrap.cxx
from:swig\python\python3\CMakeFiles\_SoapySDR3.dir\
.This causes:
"warning C4101: 'e': unreferenced local variable"
Which comes from the following repeated catch statement:
catch (const Swig::DirectorException &e) { SWIG_fail;}
This catch condition/statement need to be replaced by:
catch([[maybe_unused]] const Swig::DirectorException &e)
Because
e
is not used and also can not be disabled by#pragma warning(disable:4101)
as that only works on a function basis.The text was updated successfully, but these errors were encountered: