Mail Archives: djgpp/1999/10/07/13:35:34
FokkemaDBRA wrote:
> Hans-Bernhard Broeker (broeker AT acp3bf DOT knirsch DOT de) wrote:
> : As soon as you add the 'far' keyword, one of the most fundamental
> : assumptions in C breaks down: a pointer is a pointer is a pointer.
> What exactly do you mean by that? Does this also go for a pointer to a char?
> Why does 'far' breaks this concept down?
Because there are now to incompatible types of 'pointer to char':
char far * a_far_pointer;
char * a_near_pointer;
There are situations where you can use both, and situations where only
one type of pointer works. The C language is not prepared for such
nuisance. To give an example, every 'void *' would have to be a 'void
far *', behind the scenes, because otherwise the Standard's rule would
break that every pointer, if casted to 'void *', and later casted back
to its original type, must come out identical to what it started to.
So either far pointers aren't pointers, in the meaning of the C
Standard, or there cannot be near pointers to void, which will cause
performance losses for functions like malloc() and friends.
'far' is one big mess, and best avoided, wherever possible. At least
as long as you're willing to write *C* programs. 'C with far pointers'
is a completely different language, in the same sense that C++ is a
different language, even though many beginners have been fooled into
believing that a language called 'C/C++' exists. It doesn't.
Many C programmers who have grown up using MS-DOS C compilers, and/or
one of the many extremely badly written C textbooks surrounding them,
have been mislead to assume that 'far' (like the bad old 'void main')
is a native inhabitant of C land, and has a right to be there. It
isn't, and it hasn't.
> : "Many millions of flies eat sh*t. So we should eat it, as well." or
> : what? This argument has never been a good one.
> It was not an argument. Just a statement. With all due respect, that
> it is sh*t is just your opinion. Maybe that of countless others too,
> but it is still an opinion.
Your statement was of the kind 'many others have done it, so it must
be a good idea'. That's exactly the 'millions of flies' argument.
It's largely irrelevant if the subject matter is sh*t or not -- the
whole argument is nonsensical, either way.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -