On 15 Dec 2002 at 3:33, Frank Heckenbach wrote:
Yes, plain integers I suppose, not integers with a specified width of 32 bits.
What is a "plain" integer? Is there a guarantee that a "plain" integer in GNU C or Pascal will be the same size as a "plain" integer in Microsoft C (e.g.)?
I take the point that a WordBool is guaranteed to be the same size as a Word in GNU Pascal or an unsigned int in GNU C and therefore should be used in preference to a sized type when interfacing to other GNU modules. But is that guarantee extended to Microsoft compilers? When interfacing to a module supplied by Microsoft (or any third party), the interface requires certain parameter sizes, regardless of how they were originally defined. They may happen to coincide with GNU Pascal's Word or GNU C's unsigned int, but that isn't given.
Indeed, the GPC manual admits as much:
"The following variants of Integer, Cardinal and Word are guaranteed to be compatible to the integer types of GNU C. The sizes given, however, are _not_ guaranteed."
and:
"If you want to be sure that you have a signed integer with 32 bits width, write Integer (32), not just Integer which might be bigger."
The Win32 documentation from Microsoft says explicitly, for example, that an INT (defined in "windef.h" as "typedef int INT") is a "32-bit signed integer," so when interfacing, an INT parameter _must_ be 32 bits. I can declare the Pascal equivalent to be an Integer, but that doesn't guarantee me 32 bits according to the GPC manual, whereas "Integer (32)" does.
I presume all of this extends to "Boolean (32)" as well, or does "Boolean (32)" behave differently from "Integer (32)" in this regard?
You were replying to Chuck's statement: "And there is no need for such an entity." which was a comment about `Boolean (32)'.
I was commenting on the need (such as it is) for integers with Boolean semantics in general, not specifically a need for "Boolean (32)".
-- Dave