Thinking about it more, I can see "safe" as a procedure directive not working because there are so many contrived cases that can easily break it, and covering all those cases will make such a feature pretty much useless.

Talking about attributes, I think a better way is to mark specific variables as "safe" or "involatile", which ties in well with the proposals for the "volatile" attribute, I believe, since it will be in effect completely opposite to a volatile variable. var parameters will still be the most difficult problem to work out - one solution would be to forbid passing nonvolatile variables into var parameters, but this might seem unnecessarily picky and it doesn't solve tricks with pointers.

I figure data-flow analysis will address everything eventually, but I can't promise the compiler won't become very inefficient as a result.

Gareth aka. Kit


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

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

Reply via email to