[fpc-pascal] Illogical automatic dereferencing

Jonas Maebe jonas.maebe at elis.ugent.be
Tue Oct 13 16:14:01 CEST 2009


Florian Klaempfl wrote on Tue, 13 Oct 2009:

> When messing with pointers you've to know what to write because pointers
> allow unlimited access to internal data structures. Sorry, but I can't
> help you if you guess wrong while playing with dangerous stuff (and the
> original poster did so: using move is a dangerous operation) instead of
> reading the manual.

I think that "all pointers can be indexed as arrays" can easily cause  
accidentantal errors though. I can't find it anymore, but I remember  
Pierre once fixed a bug in the compiler sources itself where someone  
accidentally used move(pstring_var[1],...) instead of  
move(pstring_var^[1],..). That at least was not a case of not  
understanding how pointers work, but a simple case of a typo which  
couldn't be caught anymore by the compiler due to this extension.


Jonas

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




More information about the fpc-pascal mailing list