Can GCC not complain about undefined references?

Yes, it is possible to avoid reporting undefined references – using –unresolved-symbols linker option. g++ mm.cpp -Wl,–unresolved-symbols=ignore-in-object-files From man ld –unresolved-symbols=method Determine how to handle unresolved symbols. There are four possible values for method: ignore-all Do not report any unresolved symbols. report-all Report all unresolved symbols. This is the default. ignore-in-object-files Report unresolved symbols that … Read more

why am I not getting an “used uninitialized” warning from gcc in this trivial example? [duplicate]

It’s hard to say it’s a bug, because gcc mixes up code for optimization and for creating warnings, which is even documented for this particular warning: -Wuninitialized Warn if an automatic variable is used without first being initialized or if a variable may be clobbered by a setjmp call. […] Because these warnings depend on … Read more

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(…) { … }

Is there a way to suppress warnings in C# similar to Java’s @SuppressWarnings annotation?

Yes. For disabling, use: #pragma warning disable 0169, 0414, anyothernumber Where the numbers are the identifiers of the warnings that you can read from compiler output. To reenable the warnings after a particular part of code (which is a good idea) use: #pragma warning restore 0169, anythingelse This way you can make the compiler output … Read more