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