Re: a console application in C++
On Jul 17, 12:10 pm, Lionel B <m...@privacy.net> wrote:
On Tue, 17 Jul 2007 09:59:42 +0000, James Kanze wrote:
On Jul 16, 11:50 am, Lionel B <m...@privacy.net> wrote:
On Mon, 16 Jul 2007 09:07:59 +0000, arnuld wrote:
[...]
Note: the "-std=c++98 -pedantic" flags ensure that you are compiling
according to the current C++ standard without any GCC-specific
extensions/ restrictions to the language.
Note that the "-std=c++98 -pedantic" flags only affect the compiler, =
and
do *not* ensure that you are not including non-standard headers or
linking against non-standard libraries.
No indeed, they only specify the *language* standard that the compiler
should respect.
The "International Standard: Programming Languages -- C++",
ISO:IEC 14882 also defines what we traditionally would call a
library. From the point of view of the standard, the library is
part of the language (and is certainly part of the language
standard).
[...]
To summarise: the only way to ensure that you are not including non-
standard headers or linking against non-standard libraries is ... don't
include non-standard headers and don't link against non-standard
libraries.
Yup.
There are a lot of other bad practices that the compiler will
accept as well. (Things like indirectly returning a reference
to a local variable, for example.) Specifying "-std=c++98
-pendantic" is very useful. So are "-D_GLIBCXX_CONCEPT_CHECKS
-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC". But you still need
good code review.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils 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