[fpc-devel] integer, cardinal

Ales Katona ales at chello.sk
Sun Apr 17 12:45:49 CEST 2005


Jonas Maebe  wrote / napĂ­sal (a):

>
> On 17 Apr 2005, at 09:38, Yury B. wrote:
>
>>>>   for 32-bit x86... or does 64-bit platform also uses 32-bit integers
>>>>   as default, so that longint would be good?
>>>
>>
>> JM> It would break a lot of existing code if we did that. You can 
>> perfectly
>> JM> define integer to be whatever you want yourself.
>>
>> I want a kind of standard.
>
>
> I don't understand why.
>
>> If I don't need classes then I would prefer
>> not using objfpc or delphi mode (in order not to include huge fcl
>> stuff)
>
>
> They don't include any fcl stuff by default. And with smartlinking 
> turned on, the only extra thing you get from the objpas unit is a 
> procedure called ResetResourceTables (and the ResourceStringTable 
> record).
>
>> but i want integer to be natural to the platform.
>
>
> Even C is now moving more and more to types with a predictable size 
> (see all the types in C99). I think knowing how large a type is, is 
> much more important in order to create good programs than some 
> perceived speed gain (especially since you can easily redefine any 
> type to be whatever you want).
>
>
> Jonas
>
>
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
>
I think that pascal typesystem requires a bit overhaul when it comes to 
integers.

First of all Integer should be size independent, that is, xy bits 
depending on the platform. All others should be specific.

Second, we should "force people in a friendly way" to use more readible 
names like:
sint32, uint64, etc. than "cardinal"
In a few years when 64 bits are normal, what will cardinal become? who 
knows..

just one big IMHO

Ales




More information about the fpc-devel mailing list