<!DOCTYPE html>
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    I sent Jukka and Andrea's comments to the developer. Here is the
    response I received from him:<br>
    <blockquote>Thank you for you email and taking the time to actually
      get in touch with GDAL maintainers and forward their replies to
      me.<br>
      <br>
      That's an interesting statement from them. I have been working
      with shapefiles for the last 20 years and my personal
      interpretation of M array being "<i>optional</i>" has always been
      that in case no M dimensions are needed, some "<i>no data</i>"
      values can be stored in the binary file.<br>
      <br>
      For reference, on page 10 of the specs under <i><b>"Measured
          Shape Types in X,Y Space"</b></i> paragraph it reads:<br>
      <blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> 
          Shapes of this type have an additional coordinate M. Note that
        "no data" value can be specified as a value for M (see Numeric
        Types on page 2).</blockquote>
      <br>
      And on page 15 under <b><i>"Shape Types in X,Y,Z Space"</i></b>
      paragraph, again:<br>
      <blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> 
          Shapes of this type have an optional coordinate M. Note that
        "no data" value can be specified as a value for M (see Numeric
        Types on page 2).</blockquote>
      <br>
      <br>
      On page 2, <b><i>"Numeric Types"</i></b> paragraph states:<br>
      <blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> 
          [...] shapefiles support the concept of "no data" values, but
        they are currently used only for measures.<br>
            Any floating point number smaller than –1038 is considered
        by a shapefile reader to represent a "no data" value.</blockquote>
      <br>
      <br>
      Thus, my interpretation has always been something like that in
      case M array is not needed, I must fill it with <i>"no data"</i>
      values.<br>
      Probably GDAL devs know more than me, but it seems odd that in
      order to establish whether the M array is present or not in the
      binary SHP file, one needs to check the SHX index file for the
      binary address of the next record. Surely it could be, but it
      feels cumbersome to me (not that it would be the only cumbersome
      thing about shapefile specs :)) )<br>
      <br>
      About the vast majority of GIS software being able to read those
      shapefiles with missing M arrays, I have always thought they chose
      to silently ignore the missing M array of the last record as a
      favor to the user (yep, I know technically it's not just the last
      record...).<br>
      <br>
      Anyways, I am open to admit I have always been wrong with my
      interpretation of the specs (maybe even relieved), it would be
      great to have a confirmation from GDAL devs.<br>
      <br>
    </blockquote>
    I think the source of the problem is confusion between "no data" and
    "optional". I interpret "no data" as a null indicator,  to fill in
    required values but indicate that the value is meaningless, while
    "optional" means the data need not appear at all. The developer is
    not a native English speaker, which may have contributed to the
    confusion.
  </body>
</html>