suppress-warnings

Suppressing Class Method Not Found Warnings in Xcode [duplicate]

前提是你 提交于 2019-12-07 02:18:07
问题 This question already has answers here : Using #pragma to suppress “Instance method not found” warnings in Xcode (5 answers) Closed 5 years ago . I have a class whose methods are determined at runtime, as indicated in my question here. This works great, but now I have a bunch of warnings that look like the following littering my code: Class method '+objectIsNotNil:' not found (return type defaults to 'id') While these warnings don't actually affect the build process, they're very annoying and

How to find a Clang warning flag in Xcode that's not present in build logs

我是研究僧i 提交于 2019-12-07 02:02:22
问题 I've got a warning I wish to suppress in Xcode, but I cannot seem to find the name of the warning. I've enabled -fdiagnostics-show-category=name and the logs show that it's a semantic issue. Looking at Clang's source, I think I've located a test for this scenario but can't seem to track down the name of it. Currently, the build logs show this: m:89:29: warning: assigning to 'id<AProtocol>' from incompatible type 'AViewController *' [Semantic Issue] self.tableView.delegate = self.aController;

Rspec rails printing lot of warnings

痞子三分冷 提交于 2019-12-06 20:27:49
问题 I am testing a rails 4.1.0 application with rspec-rails 3.0.1. rspec command is printing a large number of warnings about the gems I am using in the application. I have included a part of the output below. I want to know whether is it possible to suppress this. /home/indika/Documents/rails/news_app/config/initializers/kramdown.rb:6: warning: method redefined; discarding old convert_img /home/indika/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/kramdown-1.4.0/lib/kramdown/converter/html.rb

Kotlin: Suppress unused Property?

人盡茶涼 提交于 2019-12-06 20:08:11
问题 My source code is as follows: There are warnings : Property '****' is never used. I added "@Suppress("UNUSED_PARAMETER")", "@Suppress("UNUSED_PROPERTY_GETTER")", "@Suppress("UNUSED_PROPERTY_SETTER")", however, none of them work. How can I suppress this warning? 回答1: Use @Suppress("unused") in order to suppress unused warning. For those cases you can use the IDE. press alt+enter : 来源: https://stackoverflow.com/questions/43192281/kotlin-suppress-unused-property

How can I suppress warnings (codebase-wide) during javadoc compilation?

*爱你&永不变心* 提交于 2019-12-06 19:48:39
问题 I'm stuck with a legacy Java codebase that has THOUSANDS of warnings when you compile it. I would love to actually fix the source of all these warnings, but unfortunately that's not an option at this time at my company (other things like "making new products that generate revenue" are considered higher priority by the people in charge; fancy that). Now, I could just live with all of these warnings, if it wasn't for the fact that they make it difficult to find actual errors in the output from

How to specifically suppress “Comparing identical expressions” in Eclipse-Helios JDT

拜拜、爱过 提交于 2019-12-06 17:27:26
问题 I tried annotating the enclosing method with @SuppressWarnings("compareIdentical") but this does not work (worse yet, the annotation results in its own Unsupported @SuppressWarnings("compareIdentical") warning!) I know that I can always use @SuppressWarnings("all") but that'd be more warning-suppression than I want. FWIW, I got the "compareIdentical" string from the "Warning Options" table in http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.jdt.doc.isv/guide/jdt_api_compile.htm (a

Is is possible to disable this warning in clang? warning: #pragma once in main file

烈酒焚心 提交于 2019-12-06 17:10:56
问题 warning: #pragma once in main file We're running our headers through clang to get a partial AST. Is it possible to disable that warning? 回答1: Use the -Wno-pragma-once-outside-header command line argument. Consult the Clang documentation here. 回答2: I had this thing when I accidentally included a header file in compile sources (this header has #pragma once line). To fix this remove header from compile sources (and probably you need to replace it with .cpp file) 回答3: There's no -W option for "

How to avoid having to use @SuppressWarnings(“unchecked”)?

时光毁灭记忆、已成空白 提交于 2019-12-06 08:53:32
I have a Cache object for persisting objects to disk, and the way I've implemented this causes me to have to use @SupressWarnings . I'm not a Java expert, but this seems like a code smell, and I'm wondering if there's a 'better' way to do what I'm doing here (for instance, somehow storing a Type when I write the cache, and reading this value to be able to instantiate a specific type?). My Cache object looks like this (not-relevant code removed for brevity): /** * Write object o to cache file * * @param cacheName * @param o * Serializable object to write to cache */ public static void put

FxCop behavior in VS2010, Code Analysis, and SuppressMessage

拟墨画扇 提交于 2019-12-06 06:21:04
问题 I have a class like this one: [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Io")] public void ParaQueFalleCalidadCodigoUnoIo_ReglaCA1709() { } public void ParaQueFalleCalidadCodigoDosIo_ReglaCA1709() { } I use a custom Ruleset file CustomRules.ruleset <RuleSet Name="RulesNet" ToolsVersion="10.0"> <RuleHintPaths> <Path>C:\Fxcop10.0\Rules</Path> </RuleHintPaths> <Rules AnalyzerId="Microsoft.Analyzers

IntelliJ IDEA @SuppressWarnings for inspection with name of tool

大兔子大兔子 提交于 2019-12-06 05:40:01
问题 I know I can suppress warnings from IntelliJ IDEA inspections like that: @SuppressWarnings("CollectionDeclaredAsConcreteClass") public PropertiesExpander(Properties properties) { this.properties.putAll(properties); } For person from outside it may not be clear for which tool this suppression is needed. PMD uses prefixes for that: @SuppressWarnings("PMD.UnusedLocalVariable") FindBugs uses dedicated annotation: @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") Is there any