Khimenko Victor wrote:
Of course, this must be fixed and changed to something Pascalish.
The question is "what is something pascalish" ? BP, Delphi and so on are all usuing the same low-lovel idiv as GCC, for example ... And produce the same result, of course... Unlike gpc BTW (gcc 2.95.2 will return the same "not very mathematically correct" values as BP/Delphi and iX86's idiv while gpc 19991030 based on gcc 2.95.2 will return "more mathematically correct" thing by adding few checks after idiv... hmm...).
So GPC should support two variants: EP (runtime error for "mod -42") and BP (positive result). I vote for the EP variant being the default behaviour with the BP variant being enabled in --borland-pascal and --delphi mode - plus an option to set it explicitly. And it must be the same behaviour for all platforms. Leaving it undefined invites for very unpleasant errors in future user programs. 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-19990118 GnuPG key fingerprint: 9E7C 0FC4 8A62 5536 1730 A932 9834 65DB 2143 9422 keys: ftp://ftp.gerwinski.de/pub/keys/ - AntiSpam: http://spam.abuse.net