Mail Archives: djgpp/1996/06/03/10:02:22
Date: Mon, 3 Jun 1996 07:50:57 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
On Thu, 30 May 1996 kagel AT quasar DOT bloomberg DOT com wrote:
> BTW: Many compilers do not support preprocessor directives that do not begin in
> column 1. GCC, and therefore DJGPP, does, as does Borland, but this may cause
> potability problems.
I don't see any portability problem here, since ANSI C explicitly permits
any amount of whitespace (and even comments) to surround the `#'
character in preprocessor directives. Hardly anyone should consider
pre-ANSI compilers nowadays.
The problem, as usual, is not with what should be but with what is. You do not
always have a choice of compilers. There are supposedly ANSI compilers that do
not support newer preprocessor constructs like whitespace around '#' and string
pasting, etc. The DEC compilers come immediately to mind! It is usually
politic (small 'p') to write to the lowest common denominator when avoiding a
feature cost you nothing. Anyway it was just an aside and suggestion.
Obviously, if your code cannot run on anything other than DOS where you have at
least four excellent compilers available there is no problem. On the other
hand if you, or anyone else reading our thread, need to write portable programs
this is one of those "Gee I didn't know that" gotcha's that one might want to
know about! And so I mentioned it...
--
Art S. Kagel, kagel AT quasar DOT bloomberg DOT com
A proverb is no proverb to you 'till life has illustrated it. -- John Keats
- Raw text -