Khimenko Victor wrote:
Hmm. Surely this program must emit run-time error: -- cut -- type my_type=(a,b,c); var x:my_type; function my_proc(x:my_type):my_type; begin my_proc:=pred(x); end; begin x:=my_proc(a); end. -- cut -- I was unable to get one but I think it's temporary limitation, right ?
Right.
C have no operations for enums while Pascal have so I'm not sure if GCC backend is powerfull enough for Pascal...
We need to produce explicit code for such checks. I think that build_pascal_binary_op() is the correct place to check whether the result fits in its type. Peter -- http://home.pages.de/~Peter.Gerwinski/ - G-N-U GmbH: http://www.g-n-u.de Maintainer GNU Pascal - http://home.pages.de/~GNU-Pascal/ - gpc-20000808 GnuPG key fingerprint: 9E7C 0FC4 8A62 5536 1730 A932 9834 65DB 2143 9422 keys: http://www.gerwinski.de/pubkeys/ - AntiSpam: http://spam.abuse.net