title: Why do the Delphi and FreePascal compilers handle 0-based and x-based static arrays differently?
body: <pre><code>program test;
  
  uses
    sysutils;
  
  const
    BUFLEN = 20;
  
  var
    Buf0: array[0..BUFLEN-1] of char;
    Buf1: array[1..BUFLEN] of char;
    s: string;
  
  begin
      // Fillchar...
      // StrPLCopy...
  
      SetString(s, Buf1, Length(Buf1));
      // Error: Incompatible type for arg no. 2: Got &quot;Array[1..20] Of Char&quot;, expected &quot;PChar&quot;
  
      SetString(s, Buf0, Length(Buf0));
      // compiles ok
  end.
  </code></pre>
  <p>In C/C++, we use array names as pointers very often. In Delphi, we can also implement this like the example above.</p>
  <p>Though, using the <code>Buf1</code> array in FreePascal's <a href="https://www.freepascal.org/docs-html/rtl/system/setstring.html" rel="nofollow noreferrer"><code>SetString()</code></a> causes an error, while the <code>Buf0</code> array works just fine. An array's base index shouldn't matter, right?</p>
  <p>Is there any documentation that <strong>justifies</strong> this behaviour?</p>
  <p>Tested in FPC 3.0.4 and Delphi 10.3.</p>