CBFalconer wrote:
Frank Heckenbach wrote:
... snip ...
To be portable, you cannot use types like `Integer' and `ShortWord' which can have different sizes. You can define your own types to be `Integer attribute (Size = 32)', `Cardinal attribute (Size = 16)' etc. Also you have to do explicit endianness conversions (see `ConvertFromLittleEndian' etc. in gpc.pas).
Let's be clear that you mean "portable over gpc installations". This will not ensure generic portability over any ISO standard.
Sure. Strictly ISO, anything involving external files is unportable -- not even the external representation of `Text' files is specified, also reading single characters from a `file of Char' and reassembling the integers is not guaranteed (by the standard) to work as expected (though it may have a higher chance of working with another ISO Pascal compiler).
In a way such may be useful, in that any transport to an ISO system should flag errors on those constructs and point out the area to be considered.
That's right. Whereas using ISO means and relying on semantics that are not guaranteed would fail silently ...
Frank