Mail Archives: djgpp/2000/05/18/10:40:05
Alexei A. Frounze <alex DOT fru AT mtu-net DOT ru> wrote:
> Hans-Bernhard Broeker wrote:
> OK. Where can I have the specs on C++ library standard?
Straight from the horse's mouth: the ISO (www.iso.ch), or its member
organization for your country, sells the Standard on paper. The cost
is rather high, though. If can do that, the way via the US-American
member organization, ANSI, offers a cheaper way: you can buy the
standard as a PDF file, with a license to print it yourself, for
something like 15 US$.
> Does DJGPP/GCC work that standard way? If so, why there is no backward
> compatibility with "complex"? Is it hard to add one extra "#define" or
> "typedef"?
The problem is that the word 'complex' itself is now used in a
fundamentally incompatible way: it used to be a type name, now it's
the name of a template. You cannot have both at the same time, AFAIK.
[...]
>> I wanted to point out that you were making a totally unjustified
>> assumption. You say you don't need size_t, if size_t and int are
>> effectively the same thing. The 'if' in that sentence is the crucial
>> part: this 'if' cannot be tested by the program.
> sizeof() :)
Doesn't help you a bit, if you want to ignore size_t altogether. And,
strictly speaking, you cannot deduce *anything* about the range of
acceptable values of a given type, nor about type compatibility, from
sizeof(). Nothing in the language definition forbids the compiler to
introduce garbage bits that serve no useful purpose than to bloat
sizeof().
[...]
>> that the definition of size_t depends on much more subtle
>> parameters. The memory model in 16bit compilers, e.g.: in 'large' or
>> 'huge' model, size_t will have to be a 32bit quantity.
> OKay, how many compilers assume different sizes of size_t due to memory
> model or *something else*?
It is completely unimportant how many such compilers there are. The
language allows for such compilers to exist, and therefore, you should
not break your code without a good need --- and code using the
assumption that 'size_t' is essentially the same as 'int', without a
very good reason for doing so, is broken, period.
> How may compilers have different memory models
> and what for (nowadays, 32-bit compilers for i386+ don't need something new
> but flat memory model (or as Eli mantioned something like 32-bit .COM))?
The 32bit flat memory model is already stretched close to its
limitations, these days. 4 Gigabytes of address space may have looked
like infinitely much, 5 years ago. These days, you can already buy
high-end PC's with 1 Gigabyte of storage --- there's not much room
left before true 'far' pointers will be needed, even for 32bit
addressing modes. Not even to mention that the era of even the 32bit
variety of x86 systems is reaching its end, these days.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -