Carsten Bager wrote on Mon, 02 Nov 2009:

As far as I can see, the problem is the compiler does not differ between an
array of char and a null terminated string.
As a result of this, if the first byte/char are 0 in both arrays the compiler
stops checking and says that there are equal.

When I implemented the current behaviour, I compared it either Turbo Pascal or Kylix 3 (which is Delphi 6.5), I'm not sure which one anymore. There, a) if the array is zero-based (i.e., lower bound is 0), then the array of char is treated as a null-terminated string b) if the array is non-zero-based, then the array of char is always checked completely

That should also be the current behaviour for FPC. So if you want to always use the full array, change your lower array bounds.


Jonas

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to