How to suppress Java compiler warnings for specific functions

If you really, really must do this, and you are sure you are not making a mistake, check out the @SuppressWarnings annotation. I suppose in your case you need @SuppressWarnings(“fallthrough”) Is the annotation @SuppressWarnings (javadoc) what you are looking for? For example: @SuppressWarnings(“unchecked”) public void someMethod(…) { … }

How do you tell Valgrind to completely suppress a particular .so file?

For most of the suppression types, you omit the wildcard, like so: { name Memcheck:Cond obj:/path/to/lib/lib.so.10.1 } { name Memcheck:Free obj:/path/to/lib/lib.so.10.1 } { name Memcheck:Value8 obj:/path/to/lib/lib.so.10.1 } Note that you must list each type of error separately, you can’t wildcard them. You must also list the entire pathname of the library (as shown by valgrind, … Read more

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

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

Use this method around (a) header(s) that you cannot or don’t want to change, but which you need to include. You can selectively, and temporarily disable all warnings like this: #pragma warning(push, 0) // Some include(s) with unfixable warnings #pragma warning(pop) Instead of 0 you can optionally pass in the warning number to disable, so … Read more

Is it possible to make valgrind ignore certain libraries?

Assuming you are running the memcheck tool and you want to ignore Leak errors in libcrypto only, you could put a suppression like: { ignore_libcrypto_conditional_jump_errors Memcheck:Leak … obj:*/libcrypto.so.* } … into a file and pass it to valgrind with –suppressions=*FILENAME*. To ignore Leak errors in all shared libraries under any lib directory (/lib, /lib64, /usr/lib, … Read more

Dynamic forwarding: suppress Incomplete Implementation warning

You can suppress Incomplete Implementation warnings by adding #pragma clang diagnostic ignored “-Wincomplete-implementation” just above the @implementation Hope this helps EDIT After being told in the comments that this didn’t work for someone and finding out the reason was because it was a different warning they were getting I have done a bit of playing … Read more