On May 4, 11:07 am, Erik Wikstr=F6m <Erik-wikst...@[EMAIL PROTECTED]
> wrote:
> On 2008-05-04 07:43, andrew.smith....@[EMAIL PROTECTED]
wrote:
> >> This program compiles fine with the command
> >> g++ -std=3Dc++98 -pedantic -Wall -Wextra x.cpp
> > Why We use These Flags.?
> -std=3Dc++98 means that we want to compile the code using the
> C++ 98 standard, -pedantic enables warnings for everything
> that should produce a warning and rejects usages of private
> extansions.
Not entirely. It does turn off some very ****table "future"
features, like long long, but it leaves some g++ extensions
active, including cases which render the compiler non-conformant
active.
> -Wall and -Wextra turns on lots of warnings in case you do
> something dubious.
And some which aren't dubious at all:-).
More to the point: if you're just learning C++, you should
probably invoke it however your instructor says to invoke it,
without worrying too much about why. Otherwise, you should
definitely read the do***entation, and understand what each
option does, and why you want it, or not. For a variety of
reasons, all compilers require a fairly long list of options in
practice---200 or 300 hundred characters seems to be about a
minimum. (I need long long in my work, for example, so I can't
use -pedantic. But I can turn on most of what -pedantic
encomp***** individually.)
--
James Kanze (GABI Software) email:james.kanze@[EMAIL PROTECTED]
en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34


|