tags:

views:

137

answers:

4

-o changes the output filename (I found that using --help)

But I can't find out what -Wall does?

+8  A: 

It's short for "warn all" -- it turns on (almost) all the warnings that g++ can tell you about. Typically a good idea, especially if you're a beginner, because understanding and fixing those warnings can help you fix lots of different kinds of problems in your code.

MatrixFrog
More warnings (some of which are pretty useful) can be turned on with `-Wextra` and `-pedantic`.
gnud
+3  A: 

It enables all warnings. (reads as "Warning All")

Bjorn J
There are actually a lot of warnings it doesn't enable (such as nonvirtual dtor in a class with virtual methods).
Mark B
+1  A: 

It shows all warnings. I'd recommend also use -pedantic to warn about some non-conformant parts of code.

Kirill V. Lyadvinsky
For gcc doc: "Some users try to use -pedantic to check programs for strict ISO C conformance. They soon find that it does not do quite what they want: it finds some non-ISO practices, but not all—only those for which ISO C requires a diagnostic, and some others for which diagnostics have been added."
AProgrammer
It doesn't give 100% guarantee, but it helps.
Kirill V. Lyadvinsky
If you hadn't written *some* instead of *all* in "to warn about *all* non-conformant parts", I wouldn't have commented. But your current formulation just spread the misconception the gcc documentation warn against.
AProgrammer
Fixed. But in practice it is rather looks like a "most of" and not "some".
Kirill V. Lyadvinsky
It shows many warnings, not all.
Bill
+2  A: 

It enables warnings which are deemed useful and easy to avoid at the source by gcc writers. There is also -W (-Wextra in newer releases) which are deemed useful but for which work-arounding false positives can be difficult or result in clumsy code.

gcc has also a bunch of other warnings, generally less useful. See http://gcc.gnu.org/onlinedocs/gcc-4.4.3/gcc/Warning-Options.html#Warning-Options

AProgrammer