J
jacob navia
Since "Spinoza" appeared here, I have started to ponder if all this
hate against Schildt by the regulars wouldn't be maybe just a character
assasination like they love to do.
So I started looking for critics to Schildt and found
http://www.lysator.liu.se/c/schildt.html
There, I can read:
<quote>
3.14
## An object is either a variable or a constant that resides at a
## physical memory address.
In C, a constant does not reside in memory, (except for some string
literals) and so is not an object.
<end quote>
This is completely wrong. Outside some constants that are inlined by the
compiler because the processor supports inlined constants, all other
constants are just like a character string.
For instance in a x86 implementation:
double a = 12.345;
The double constant 12.345 will reside in memory.
Why?
Because the machine doesn't support inlined floating point constants!
The same for long double constants, for structures initialized by
constants, for 64 bit constants, etc etc.
All those constants must be LOADED into their correct places by
the compiler. This happens automatically so for the user in high
level C it *looks* like they aren't there. That is WRONG though.
They reside on memory.
The only exceptions are constants that the processor accepts as
part of the instruction. For instance, the x86 accepts integers
up to 32 bits as immediate constants available in the instructions
themselves.
The power PC processor accepts constants up to 16 bit only. All other
integers must be loaded, the same as floating point data.
Conclusion:
The only constants that are initialized inline are the inlined constants
accepted inline by the processor (in the code stream)
Schild is right and Mr Feather (that I respect of course) is wrong.
Mainly the other criticism are matters of style, where Mr Feather
differs from Mr Schildt. He would have more explained about the
standard, more precise stuff, etc.
For instance Schildt says:
this limits the total character set to 255 characters.
and Feather criticises:
Actually, it limits it to UCHAR_MAX characters, which is at least 255,
but can be more.
Great. Obviously Feather is pedantically right, but is it very important?
Maybe. This is a matter of style, and doesn't justify the attacks
that are given here.
hate against Schildt by the regulars wouldn't be maybe just a character
assasination like they love to do.
So I started looking for critics to Schildt and found
http://www.lysator.liu.se/c/schildt.html
There, I can read:
<quote>
3.14
## An object is either a variable or a constant that resides at a
## physical memory address.
In C, a constant does not reside in memory, (except for some string
literals) and so is not an object.
<end quote>
This is completely wrong. Outside some constants that are inlined by the
compiler because the processor supports inlined constants, all other
constants are just like a character string.
For instance in a x86 implementation:
double a = 12.345;
The double constant 12.345 will reside in memory.
Why?
Because the machine doesn't support inlined floating point constants!
The same for long double constants, for structures initialized by
constants, for 64 bit constants, etc etc.
All those constants must be LOADED into their correct places by
the compiler. This happens automatically so for the user in high
level C it *looks* like they aren't there. That is WRONG though.
They reside on memory.
The only exceptions are constants that the processor accepts as
part of the instruction. For instance, the x86 accepts integers
up to 32 bits as immediate constants available in the instructions
themselves.
The power PC processor accepts constants up to 16 bit only. All other
integers must be loaded, the same as floating point data.
Conclusion:
The only constants that are initialized inline are the inlined constants
accepted inline by the processor (in the code stream)
Schild is right and Mr Feather (that I respect of course) is wrong.
Mainly the other criticism are matters of style, where Mr Feather
differs from Mr Schildt. He would have more explained about the
standard, more precise stuff, etc.
For instance Schildt says:
this limits the total character set to 255 characters.
and Feather criticises:
Actually, it limits it to UCHAR_MAX characters, which is at least 255,
but can be more.
Great. Obviously Feather is pedantically right, but is it very important?
Maybe. This is a matter of style, and doesn't justify the attacks
that are given here.