19.01.2010 17:49, JoshyFun пишет:
var
   p: pchar;
begin
   GetMem(p,10);
   inc(p,random(30));

Yes, this is among things which should probably be immediately disallowed at compile-time (as long as one wants reasonably safe pointers) because they are hard (or expensive) to validate later.

I usually try to not use raw pointer arithmetics and either use new/dispose with typed pointers or constructs like GetMem(X, SizeOf(X^)). However, compiler does not force me to do so.

Nikolai
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to