Mail Archives: djgpp/2001/06/08/03:05:53
> From: "Sanity in Anarchy" <mysticmass AT hotmail DOT com>
> Date: Thu, 07 Jun 2001 21:10:45 -0500
>
> My problem is this: No matter what I am compiling, I always get these
> messages about "ANSI C++ forbids this" and "ANSI C++ forbids that" and I
> don't know what ANSI C++ is.
ANSI C++ is the international standard for the C++ programming
language. The compiler tells you that some of your code goes against
the standard's definition of the language.
> I also know that, disregarding ANSI, my code is flawless
If the compiler prints warnings, your code isn't flawless. You should
look carefully at each place in your code which triggers a warning,
and try to understand what's wrong there using the compiler message as
your guide. If you cannot figure that out, try posting the relevant
code fragments and the messages here.
> and actually worked with previous versions of DJGPP, but now even
> programs that came with the books, and simple things like #include
> <iostream.h> or #include <windows.h> cause my compiler to produce
> nausiating lists of errors
The ANSI C++ standard was released not long time ago, and the latest
versions of C++ compilers only now begin to issue the diagnostics
according to the latest standard version. This causes many programs
which previously compiled without a hitch to spit warnings. The same
happens with books: their code was tested with old versions of
compilers which didn't yet support all the ANSI C++ features.
> Should I learn ANSI C++?
Definitely. You cannot in good faith write C++ in your CV without
being familiar with the standard for that language.
> Are there advantages?
Yes. Programs which comply to ANSO C++ normally trigger less bugs in
compilers, and are more portable.
> And if not, is there a
> .zip I forgot to download, or is there something with the name fixincludes
> staring me in the face?
Forget about fixincludes and -traditional: this is not the right
solution to your problems.
- Raw text -