<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>C supports const function parameters and the compiler will
      enforce it if you are including the correct header file.  You are
      conflating const with function overloading.  The prototypes below
      are equivalent between C and C++.  The only difference is that the
      C++ version uses name mangling to make the function symbols unique
      while in C you must do that yourself.<br>
    </p>
    <p>C:</p>
    <p>void foo(int *ptr);</p>
    <p>void const_foo(const int *ptr);</p>
    <p>C++:</p>
    <p>void foo(int *ptr);</p>
    <p>void foo(const int *ptr);<br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 2/17/2017 12:07 PM, Behdad Esfahbod
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAF63+7VNaqf9Kwmy_eK+XSVfvZbkaR3cpstDXDLznv-UmJ=a+g@mail.gmail.com"
      type="cite">
      <div dir="ltr">Plus, in C there's no way to correctly annotate a
        function like cairo_reference().  In C++ you can define a
        version taking const and a non-const version.  In C, you can't.<br>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Fri, Feb 17, 2017 at 10:44 AM,
          Lawrence D'Oliveiro <span dir="ltr"><<a
              moz-do-not-send="true"
              href="mailto:ldo@geek-central.gen.nz" target="_blank">ldo@geek-central.gen.nz</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex"><span
              class="">On Fri, 17 Feb 2017 09:01:44 -0800, Bryce
              Harrington wrote:<br>
              <br>
              > Perhaps at that time the usefulness of<br>
              > const'ing parameters was not held as a consensus of
              the developers at<br>
              > that time.<br>
              <br>
            </span>You have to distinguish between interface and
            implementation. C doesn’t<br>
            offer any way to say that any modifications to the object
            are not<br>
            visible to the user.<br>
            <div class="HOEnZb">
              <div class="h5">--<br>
                cairo mailing list<br>
                <a moz-do-not-send="true"
                  href="mailto:cairo@cairographics.org">cairo@cairographics.org</a><br>
                <a moz-do-not-send="true"
                  href="https://lists.cairographics.org/mailman/listinfo/cairo"
                  rel="noreferrer" target="_blank">https://lists.cairographics.<wbr>org/mailman/listinfo/cairo</a></div>
            </div>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <br>
        -- <br>
        <div class="gmail_signature" data-smartmail="gmail_signature">behdad<br>
          <a moz-do-not-send="true" href="http://behdad.org/"
            target="_blank">http://behdad.org/</a></div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    <br>
  </body>
</html>