Re: Read a file line by line and write each line to a file based on
the 5th byte
On May 15, 11:50 pm, "Alf P. Steinbach" <al...@start.no> wrote:
* James Kanze:
On May 15, 12:55 pm, "Alf P. Steinbach" <al...@start.no> wrote:
What if a compiler does not provide a checking operator[]?
Don't use it. And yes, I know, one doesn't always have that
option. But G++ and VC++ do behave correctly, which means
that the two most widely used compilers are OK.
For MSVC it depends very much on version, e.g. no such in 7.1.
For g++ it involves using a special debugging version of the
standard library, by defining _GLIBCXX_DEBUG.
Which means it must be applied to all compilation units, or
none.
Both compilers require a fistful of options to be in anyway
usable:
For VC++ (8.0):
-DNOMINMAX -DGB_EFmtDoesntWork -D_CRT_SECURE_NO_DEPRECATE
-vmg -GR -Gy -EHs -Zc:forScope,wchar_t -J -nologo -MDd
-GS- -Zi -w -D_DEBUG
For g++ (4.0 and up):
-Wno-missing-field-initializers -fdiagnostics-show-option
-std=c++98 -pedantic -ffor-scope -fno-gnu-keywords
-foperator-names -pipe -Wall -W -Wno-sign-compare
-Wno-deprecated -Wno-non-virtual-dtor -Wpointer-arith
-Wno-unused -Wno-switch -Wno-missing-braces -Wno-long-long
-ggdb3 -D_GLIBCXX_CONCEPT_CHECKS -D_GLIBCXX_DEBUG
-D_GLIBCXX_DEBUG_PEDANTIC
(Extracted from my makefiles, so it's possible that there is
some historic crud in there.)
Anyways, it's tool specific.
Handling erroneous code always is.
--
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