[fpc-devel] open array and address of "@" / crash, why?
Jonas Maebe
jonas.maebe at elis.ugent.be
Sun Mar 30 15:35:13 CEST 2014
On 30/03/14 15:24, Martin Frb wrote:
> The below program compiles fine (and generates no warning (fpc 2.6.2 /
> win 32)
It only compiles fine with the (default) {$t-}. If you add {$t+}, it
doesn't compile. Without typed pointers, the result of the @-operator is
an untyped pointer, which by definition is assignment-compatible with
all other pointer types.
Making {$t+} the default is hard because it could break existing,
correct code (e.g., "untypedptr:=@wordvar+1" would result in a pointer 2
bytes after @wordvar instead of 1 with {$t+}).
Jonas
More information about the fpc-devel
mailing list