<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><tt>Thanks Kristian,</tt></p>
    <p><tt>On Solaris, NAN is not available with C89. Is there an issue
        to build proj 5 forcing C99 by replacing -std=c89 to -std=c99 in
        the Makefile, after configure ?</tt></p>
    <p><tt><br>
      </tt></p>
    <p><tt>Regards.<br>
      </tt></p>
    <br>
    <div class="moz-cite-prefix">Le 21/08/2019 à 12:43, Kristian Evers a
      écrit :<br>
    </div>
    <blockquote type="cite"
      cite="mid:73C2B9B9-D0AC-41C0-9E3D-092EABBE28C4@sdfe.dk">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      Eric,
      <div class=""><br class="">
      </div>
      <div class="">A C++11 compatible compiler is only required for
        PROJ 6 and onwards. This was introduced with RFC3 [0]. Previous
        versions was strictly C89, hence the enforcement of that
        standard in PROJ 5.2.0.</div>
      <div class=""><br class="">
      </div>
      <div class="">/Kristian</div>
      <div class=""><br class="">
      </div>
      <div class="">[0] <a
          href="https://proj.org/community/rfc/rfc-3.html" class=""
          moz-do-not-send="true">https://proj.org/community/rfc/rfc-3.html</a><br
          class="">
        <div><br class="">
          <blockquote type="cite" class="">
            <div class="">On 16 Aug 2019, at 14:57, Dechaux Eric CEN
              (BCQ STIG) <<a
                href="mailto:eric.dechaux@gendarmerie.interieur.gouv.fr"
                class="" moz-do-not-send="true">eric.dechaux@gendarmerie.interieur.gouv.fr</a>>
              wrote:</div>
            <br class="Apple-interchange-newline">
            <div class="">
              <div class="">Greetings,<br class="">
                <br class="">
                I have been investigating proj 5.2.0 build failure on
                Solaris 11.3 for amd64. At some point the build stops on
                error because of the NAN being not declared :<br
                  class="">
                <br class="">
                gcc -DHAVE_CONFIG_H -I.
                -DPROJ_LIB=\"/appli/stig/11.3-20190816-104632/share/proj\"
                -DMUTEX_pthread  -D_FORTIFY_SOURCE=2 -I/usr/include/pcre
                -I/appli/stig/11.3-20190816-104632/include -Wall
                -Wdeclaration-after-statement -Wextra -Winit-self
                -Wunused-parameter -Wmissing-prototypes
                -Wmissing-declarations -Wformat -Werror=format-security
                -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla
                -Wdeclaration-after-statement -Wdate-time
                -Wfloat-conversion -std=gnu89 -m64 -O2
                -fstack-protector-strong -fpic -fPIC
                --param=ssp-buffer-size=4
                -I/appli/stig/11.3-20190816-104632/include
                -DHAVE_C99_MATH=1 -MT proj_strtod.o -MD -MP -MF
                .deps/proj_strtod.Tpo -c -o proj_strtod.o proj_strtod.c<br
                  class="">
                gie.c: In function ‘cart_selftest’:<br class="">
                gie.c:2008:20: error: ‘NAN’ undeclared (first use in
                this function)<br class="">
                     a = proj_coord(NAN, NAN, NAN, NAN);<br class="">
                                    ^<br class="">
                gie.c:2008:20: note: each undeclared identifier is
                reported only once for each function it appears in<br
                  class="">
                make[2]: *** [gie.o] Erreur 1<br class="">
                <br class="">
                <br class="">
                As the documentation specify a C and C++11 compiler is
                required I changed the CFLAGS to include -std=gnu11. The
                build and checks run without errror. Solaris 11.3 is
                bundled with GCC 5.3 with uses gnu11 by default for C
                and there should be no reason to force for it on the
                CFLAGS.<br class="">
                <br class="">
                I noticed the configure script detects and automatically
                adds -std=gnu89 to the CFLAGS :<br class="">
                <br class="">
                    checking whether C compiler accepts -Wdocumentation
                -Wno-documentation-deprecated-sync... no<br class="">
                    checking if -std=gnu89 can be enabled... yes<br
                  class="">
                    checking whether C++ compiler accepts
                -Wunused-private-field... no<br class="">
                <br class="">
                <br class="">
                On Solaris this disables the NAN macro as it is C99:<br
                  class="">
                <br class="">
                $ cat test.c<br class="">
                #include <stdlib.h><br class="">
                #include <math.h><br class="">
                <br class="">
                int main (void) {<br class="">
                <br class="">
                        float f ;<br class="">
                        f = NAN ;<br class="">
                <br class="">
                <br class="">
                        exit (EXIT_SUCCESS) ;<br class="">
                }<br class="">
                <br class="">
                $ gcc -std=gnu89 test.c<br class="">
                test.c: In function ‘main’:<br class="">
                test.c:7:6: error: ‘NAN’ undeclared (first use in this
                function)<br class="">
                  f = NAN ;<br class="">
                      ^<br class="">
                test.c:7:6: note: each undeclared identifier is reported
                only once for each function it appears in<br class="">
                <br class="">
                $ gcc -std=gnu99 test.c<br class="">
                <br class="">
                $ gcc -std=gnu11 test.c<br class="">
                <br class="">
                <br class="">
                <br class="">
                What is the purpose of forcing C standard to gnu89  ?<br
                  class="">
                <br class="">
                <br class="">
                <br class="">
                Thanks.<br class="">
                <br class="">
                -- Eric<br class="">
                <br class="">
                <br class="">
                Ce message �lectronique et tous les fichiers attach�s
                qu'il contient sont confidentiels et destin�s
                exclusivement � l'usage de la personne � laquelle ils
                sont adress�s. Si vous avez re�u ce message par erreur,
                merci de le retourner � son �metteur. La publication,
                l'usage, la distribution, l'impression ou la copie non
                autoris�e de ce message et des attachements qu'il
                contient sont strictement interdits.<br class="">
                <br class="">
                En cas d'urgence, composez le 17 ou le 112.<br class="">
                Afin de contribuer au respect de l'environnement, merci
                de n'imprimer cet e-mail qu'en cas de necessite.<br
                  class="">
                <br class="">
                This e-mail and any files transmitted with it are
                confidential and intended solely for the use of the
                individual to whom it is addressed. If you have received
                this email in error please send it back to the person
                that sent it to you. Unauthorized publication, use,
                dissemination, forwarding, printing or copying of this
                email and its associated attachments is strictly
                prohibited.<br class="">
                <br class="">
                In case of emergency, dial number 17 or 112.<br class="">
                To contribute to the environmental protection, please
                print this e-mail only if necessary.
                <br class="">
                _______________________________________________<br
                  class="">
                PROJ mailing list<br class="">
                <a href="mailto:PROJ@lists.osgeo.org" class=""
                  moz-do-not-send="true">PROJ@lists.osgeo.org</a><br
                  class="">
                <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/proj">https://lists.osgeo.org/mailman/listinfo/proj</a><br
                  class="">
              </div>
            </div>
          </blockquote>
        </div>
        <br class="">
      </div>
    </blockquote>
    <br>
    <div class="moz-signature">-- <br>
      <img
        src="cid:part4.D355A2AD.8329CAB7@gendarmerie.interieur.gouv.fr"
        border="0"></div>
  </body>
</html>