[fpc-pascal]No runtime range checking?

Andy Sy andy at nospam.com
Thu Oct 2 13:45:29 CEST 2003


Michael Van Canneyt wrote:

> Delphi doesn't compile your program:
> malpertuus: ~ >dcc32 /CC -$$R+ -$$P+ -$$V+ testr.pp
> Borland Delphi  Version 13.0  Copyright (c) 1983,99 Inprise Corporation
> E:\root\testr.pp(16) Error: Incompatible types: 'stringy' and 'String'
> E:\root\testr.pp(17) Error: Incompatible types: 'Array' and 'String'
> E:\root\testr.pp(20)

I suppose this is because I'm assigning a larger string
to an array[] of char that cannot hold it.  Strange, even
with runtime range checking on, fpc doesn't catch this
problem.  dcc apparently does as early as compile time...
or am I missing something here?

Also, will the writing outside of array bounds in lines 16
and 17 corrupt memory even with runtime range checking on?
With RRC off, I'm almost sure it will, correct?






More information about the fpc-pascal mailing list