suppress-warnings

Suppress warning “QApplication was not created in main() thread”

独自空忆成欢 提交于 2019-11-29 10:26:06
I've created a Qt-based network library for use with applications that are not running a Qt event loop, and which are not necessarily otherwise Qt applications. This was made possible by creating a QCoreApplication instance in a thread per the answer from Is it possible to create local event loops without calling QApplication::exec()? This works perfectly, but it makes Qt upset (I presume it's worried that I'll try to manipulate a GUI outside of the main thread which wouldn't work, but I'm not), and so it prints a warning: WARNING: QApplication was not created in main() thread . I'd like to

disable warning c4702 seems not work for VS 2012

若如初见. 提交于 2019-11-29 09:28:10
I have some code for testing that i added upfront the rest of the code, so the rest would never be reached in the test. Since i have warning level 4 set, this results in an c4702: unreachable-code warning I tried disabling like this: //do something return 0; /*-------------------------------------------------------------------------*/ #pragma warning(disable: 4702) //real code but the compiler still moans. And because i have set to treat every warning as an error, this won't compile... I am using Visual Studio 2012 Premium... Any help would be gladly appreciated. You maybe just need to place

TYPO3: how to supress deprecated warnings?

北城以北 提交于 2019-11-29 07:32:13
I tried modifying the php.ini file (error_reporting = E_ALL & ~E_DEPRECATED), but with no result. There's an older TYPO3 project which I would like to examine, and all these warnings are really annoying.. Thanks in advance. I'm not sure if this will work on your version of Typo3 but try setting the following options in the typo3conf/localconf.php or via the Install Tool. $TYPO3_CONF_VARS['SYS']['displayErrors'] = '0'; // or '-1' to see other errors $TYPO3_CONF_VARS['SYS']['errorHandlerErrors'] = 22519; // E_ALL ^ E_DEPRECATED ^ E_NOTICE (everything except deprecated-msgs and notices) $TYPO3

cross platform macro for silencing unused variables warning

此生再无相见时 提交于 2019-11-29 06:54:38
In porting a large piece of C++ code from Visual Studio (2008) to Xcode (4.4+), I encounter lines such as: UNUSED_ALWAYS(someVar); the UNUSED_ALWAYS(x) (through UNUSED(x) ) macro expands to x which seems to silence Visual C++ just fine. It's not enough for Clang however. With Clang, I usually use the #pragma unused x directive. The UNUSED_ALWAYS and UNUSED macros are defined in an artificial windows.h header which I control that contains a number of utilities to help Xcode compile Windows stuff. Is there a way to define UNUSED(x) to expand to #pragma unused x ? I tried this, which Clang fails

Is it alright to suppress/hide PHP notices?

纵饮孤独 提交于 2019-11-29 06:02:42
问题 I've suppressed notices for quite some time with no problems whatsoever but I am beginning to wonder if I'm doing the right thing. I can't seem to find any logical reason why I shouldn't just suppress them but some other people seem to think that suppressing them using error_reporting is a horrible thing to do, but why? The closest thing to an answer I could find was in this question but that's still far from the answer I'm looking for. Is there some sort of unforeseen downside to hiding all

How do I get warnings.warn to issue a warning and not ignore the line?

戏子无情 提交于 2019-11-29 05:30:21
I'm trying to raise a DeprecationWarning , with a code snippet based on the example shown in the docs. http://docs.python.org/2/library/warnings.html#warnings.warn Official def deprecation(message): warnings.warn(message, DeprecationWarning, stacklevel=2) Mine import warnings warnings.warn("This is a warnings.", DeprecationWarning, stacklevel=2) is None # returns True I've tried removing the stacklevel argument, setting it to negative, 0, 2 and 20000. The warning is always silently swallowed. It doesn't issue a warning or raise an exception. It just ignores the line and returns None . The docs

Android Studio - remove Security Exception warning

半世苍凉 提交于 2019-11-29 02:47:42
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 requires permission which may be rejected by user: code should explicitly check to see if permission is

Turn off designated initializer checking in Xcode 6

跟風遠走 提交于 2019-11-29 02:27:18
问题 I'm getting the compile error: error: convenience initializer missing a 'self' call to another initializer [-Werror,-Wobjc-designated-initializers] Compile-checked designated initializers might be a good thing, but if I don't want deal with that right now, how can I turn this off? 回答1: Following on from Clay's answer.. Method 3 You might want to suppress the warning on one occurrence, not all of them: #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wobjc-designated

@SuppressWarnings(“serial”)

核能气质少年 提交于 2019-11-29 02:17:35
问题 I have a question because I'm getting a little confused (or maybe I'm not noticing something obvious). Let's say that I've got some source code that contains a lot of classes which contain a great number of static fields defined like this one: public final class ConverterTYPE { private final static HashMap<String, Byte> STRING_MAP = new HashMap<String, Byte>() { { put("A", new Byte((byte)12)); put("B", new Byte((byte)13)); } }; } As we all know, static fields are not going to be serialized.

Mark unused parameters in Kotlin

心不动则不痛 提交于 2019-11-29 00:51:22
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? bashor 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: Int) { fun bar(c: Int) {} } @Suppress("UNUSED_PARAMETER") class Baz { fun foo(a: Int, b: Int) { fun