How can I turn on (literally) ALL of GCC’s warnings?

You can’t. The manual for GCC 4.4.0 is only comprehensive for that version, but it does list all the possible warnings for 4.4.0. They’re not all on the page you link to though. For instance, some language-specific options are on the pages for C++ options or Objective-C options. To find them all, you’re better off … Read more

How to disable GCC warnings for a few lines of code

It appears this can be done. I’m unable to determine the version of GCC that it was added, but it was sometime before June 2010. Here’s an example: #pragma GCC diagnostic error “-Wuninitialized” foo(a); /* error is given for this one */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored “-Wuninitialized” foo(b); /* no diagnostic … Read more

What is the list of valid @SuppressWarnings warning names in Java?

It depends on your IDE or compiler. Here is a list for Eclipse Galileo: all to suppress all warnings boxing to suppress warnings relative to boxing/unboxing operations cast to suppress warnings relative to cast operations dep-ann to suppress warnings relative to deprecated annotation deprecation to suppress warnings relative to deprecation fallthrough to suppress warnings relative … Read more

Why should I always enable compiler warnings?

Why should I enable warnings? C and C++ compilers are notoriously bad at reporting some common programmer mistakes by default, such as: forgetting to initialise a variable forgetting to return a value from a function arguments in printf and scanf families not matching the format string a function is used without being declared beforehand (C … Read more

How to disable unused code warnings in Rust?

You can either: Add an allow attribute on a struct, module, function, etc.: #[allow(dead_code)] struct SemanticDirection; Add a crate-level allow attribute; notice the !: #![allow(dead_code)] Pass it to rustc: rustc -A dead_code main.rs Pass it using cargo via the RUSTFLAGS environment variable: RUSTFLAGS=”$RUSTFLAGS -A dead_code” cargo build