[fpc-devel] Possible idea... "safe" subroutines/methods

J. Gareth Moreton gareth at moreton-family.com
Sat May 4 23:31:34 CEST 2019


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




More information about the fpc-devel mailing list