[fpc-devel] About typecasts and the documentation

2014-02-08 Thread Martin Frb
http://www.freepascal.org/docs-html/ref/refse67.html#x124-13400012.4 In general, the type size of the expression and the size of the type cast must be the same. However, for ordinal types (byte, char, word, boolean, enumerates) this is not so, they can be used interchangeably. That is, the

[fpc-devel] incompatibility change to default param in trunk?

2014-02-08 Thread Martin Frb
Below works with 2.6.2 but not with trunk Is that indented? the wiki says Default values are now properly typechecked * *Old behaviour*: The compiler did not detect default values for parameters of which the type did not in any way correspond to the parameter type. *

Re: [fpc-devel] About typecasts and the documentation

2014-02-08 Thread Martin Frb
On 08/02/2014 19:25, Martin Frb wrote: In the below (first) example longint(1) and TFoo have the same size. Yet in the first example they fail. This is not covered by the documentation. The doc even gives examples involving typecasting constant values. Byte(’A’) given that the doc

Re: [fpc-devel] About typecasts and the documentation

2014-02-08 Thread Hans-Peter Diettrich
Martin Frb schrieb: http://www.freepascal.org/docs-html/ref/refse67.html#x124-13400012.4 In general, the type size of the expression and the size of the type cast must be the same. However, for ordinal types (byte, char, word, boolean, enumerates) this is not so, they can be used

Re: [fpc-devel] About typecasts and the documentation

2014-02-08 Thread Martin Frb
On 08/02/2014 21:59, Hans-Peter Diettrich wrote: Typecasts can be further restricted to *compatible* types. Here numeric types seem to be compatible with other numeric types, but not with structured types (records...). Well than that needs to be added to the docs. I have no problems with it