suppress-warnings

Avoid warning 'Unreferenced Formal Parameter'

人走茶凉 提交于 2019-11-27 18:18:57
I have a super class like this: class Parent { public: virtual void Function(int param); }; void Parent::Function(int param) { std::cout << param << std::endl; } ..and a sub-class like this: class Child : public Parent { public: void Function(int param); }; void Child::Function(int param) { ;//Do nothing } When I compile the sub-class .cpp file, I get this error warning C4100: 'param' : unreferenced formal parameter As a practice, we used to treat warnings as errors. How to avoid the above warning? Thanks. In C++ you don't have to give a parameter that you aren't using a name so you can just

Disable warnings in Xcode from frameworks

两盒软妹~` 提交于 2019-11-27 17:06:23
I have imported the three20 project into my project, and when I upgraded to Xcode 4.2 with iOS 5, a bunch of warnings appeared in the project. I don't care about them, but they make a lot of noise, and it's easy to miss any real warnings in my project now. Is there a way to disable warnings for those specific libraries? If your third-party libraries are added as a separate target, you can check Inhibit all warnings for that specific target to turn all warnings off. If your library is added as plain source files to your current target, you can set -w compiler flag for individual sources to mute

Android Studio - remove Security Exception warning

僤鯓⒐⒋嵵緔 提交于 2019-11-27 17:04:36
问题 I'm getting the user's location through Location location = LocationServices.FusedLocationApi.getLastLocation( mGoogleApiClient); This line of code is inside a method and before calling this method I do check for Android run time permissions. Only if the permission is available from the user then I call this method. Code is working perfectly. The problem is that Android Studio still shows an error on this line not recognising that I've already checked before calling this function. Call

Mark unused parameters in Kotlin

隐身守侯 提交于 2019-11-27 14:29:03
问题 I am defining some functions to be used as callbacks and not all of them use all their parameters. How can I mark unused parameters so that the compiler won't give me warnings about them? 回答1: With the @Suppress annotation You can suppress any diagnostics on any declaration or expression. Examples: Suppress warning on parameter: fun foo(a: Int, @Suppress("UNUSED_PARAMETER") b: Int) = a Suppress all UNUSED_PARAMETER warnings inside declaration @Suppress("UNUSED_PARAMETER") fun foo(a: Int, b:

Suppress console output in PowerShell

[亡魂溺海] 提交于 2019-11-27 14:17:51
问题 I have a call to GPG in the following way in a PowerShell script: $key = & 'gpg' --decrypt "secret.gpg" --quiet --no-verbose > $null I don't want any output from GPG to be seen on the main console when I'm running the script. Due to my noobness in PowerShell, I don't know how to do this. I searched Stack Overflow and googled for a way to do it, found a lot of ways to do it, but non of it worked. The "> $null" for example has no effect. I found the --quiet --no-verbose options for GPG to put

Is it possible to make valgrind ignore certain libraries?

痴心易碎 提交于 2019-11-27 14:15:53
Or preferably all of them instead of just my code? My program uses Gtk, Loudmouth and few other things, and these two (and some behind them, libgcrypto, libssl) are causing so many errors themselves that I'm unable to detect my own. Is it possible to make valgrind ignore things coming from deeper than my own code? You can generate suppressions for the errors for the libraries, but I don't think you can exclude the libraries generally. Also it's hard to automatically know if a memory error in the library is caused by a problem in your code or not. Assuming you are running the memcheck tool and

Is there an equivalent to SuppressWarnings in Scala?

老子叫甜甜 提交于 2019-11-27 13:24:34
问题 I was wondering if scala had an equivalent to java's @SuppressWarnings that can be applied to a function or whatever to ignore any deprecation warnings[1] that function emits? 1: Relevant warning in my case is: method stop in class Thread is deprecated: see corresponding Javadoc for more information. I am aware of the problems with stop however there are still some cases where due to legacy code we have to use it. 回答1: No, and an enhancement request [1] for such a feature was closed as

What do @SuppressWarnings(“deprecation”) and (“unused”) mean in Java?

杀马特。学长 韩版系。学妹 提交于 2019-11-27 11:52:05
问题 What do these lines in my Java or Android project mean? @SuppressWarnings("deprecation") @SuppressWarnings("unused") 回答1: The @SuppressWarnings annotation disables certain compiler warnings. In this case, the warning about deprecated code ( "deprecation" ) and unused local variables or unused private methods ( "unused" ). This article explains the possible values. 回答2: One more thing: you can not only add them inline, but also annotate methods. F.ex. @Override @SuppressWarnings("deprecation")

How to suppress warnings in external headers in Visual C++

人走茶凉 提交于 2019-11-27 11:25:55
I'm starting a new BREW project, and I'd like to compile with Warning Level 4 (/W4) to keep the application code nice and clean. The problem is that the BREW headers themselves don't compile cleanly with /W4. In gcc you can differentiate between application and system headers by using -I and -isystem, and then by default gcc doesn't report any compilation warnings in system headers. Is there an equivalent mechanism in Visual C++? Only use this method around a block of headers that you cannot change, but that you need to include. You can selectively, and temporarily disable all warnings like

How to disable warnings for particular include files?

廉价感情. 提交于 2019-11-27 11:24:55
I wold like to disable particular warnings for all files that are included, directly or indirectly, by particular include files. For example, I want to disable the warning "you are assigning a string literal to a char*", for all files or files included by files included by a #include <bar/*> (the star in my case means "anything may be here"). The reason is, some of the people I have to program with just can't use "const", so in the end I get lots of warnings about that particular string literal abuse. I would like to ignore those thousands of warnings coming from their code, so I can