How to suppress Java warnings for specific directories or files such as generated code

Starting with version 3.8 M6, Eclipse (to be exact: the JDT) has built-in functionality for this. It is configurable through a project’s build path: Project properties > Java Build Path > Compiler > Source Announced here: Eclipse 3.8 and 4.2 M6 – New and Noteworthy, called Selectively ignore errors/warnings from source folders. That’s also where … Read more

Suppressing “is never used” and “is never assigned to” warnings in C#

Yes, these can be suppressed. Normally, I’m opposed to suppressing warnings, but in this case, structs used for interop absolutely requires some fields to be present, even though you never intend to (or can) use them, so in this case I think it should be justified. Normally, to suppress those two warnings, you would fix … Read more

Mark unused parameters in Kotlin

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) { … Read more

Disable messages upon loading a package

Just use suppressMessages() around your library() call: edd@max:~$ R R version 2.14.1 (2011-12-22) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-pc-linux-gnu (64-bit) […] R> suppressMessages(library(ROCR)) R> # silently loaded R> search() [1] “.GlobalEnv” “package:ROCR” # it’s really there [3] “package:gplots” “package:KernSmooth” [5] “package:grid” “package:caTools” [7] “package:bitops” “package:gdata” [9] “package:gtools” “package:stats” … Read more

Is there a way to suppress warnings in Xcode?

To disable warnings on a per-file basis, using Xcode 3 and llvm-gcc-4.2 you can use: #pragma GCC diagnostic ignored “-Wwarning-flag” Where warning name is some gcc warning flag. This overrides any warning flags on the command line. It doesn’t work with all warnings though. Add -fdiagnostics-show-option to your CFLAGS and you can see which flag … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)