Skip to content
Tcl Source Code History Of Ticket e058307eef73cf21
Login

History Of Ticket e058307eef73cf21

Artifacts Associated With Ticket e058307eef73cf21

  1. Ticket change [b561bd1942] (rid 158605) by anonymous on 2017-11-17 21:19:51:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      After check-in 49ecc78c8b tclUnixPort.h contains the following
      
      #include <float.h>
      #ifndef NO_VALUES_H
      #   include <values.h>
      #endif
      
      The Macintosh does not have values.h.  Somehow this is detected by the Tcl
      configure script, causing -DNO_VALUES_H to be added to CFLAGS.  With this, the
      core-8-branch of Tcl builds correctly.  However, the trunk branch of Tk now
      fails to build.
      
      There are two parts to this failure.
      
      1) The Mac port of Tk uses the unix/configure script which either does
      not check for values.h or perhaps was built on a unix system that does have
      values.h.  (There is no autoconf in the XCode toolchain.) In any case,
      -DNO_VALUES_H does not get added to the CFLAGS when building Tk.
      
      2) Because TkMacOSXNotify.c needs to use a stub function defined in
      TclMacOSXNotify.c, it includes tclInt.h which in turn includes tclUnixPort.h.
      Because of the code above, this include fails since NO_VALUES_H is not
      defined and values.h does not exist.
      
      When I look at values.h on my linux system I find this comment:
      
      /* This interface is obsolete.  New programs should use
         <limits.h> and/or <float.h> instead of <values.h>.  */
      
      So it would seem to me that, in addition to getting rid of compat/float.h
      Tcl should get rid of all references to values.h.  There is no issue with
      limits.h.  Both Tcl and Tk include limits.h on the macintosh and on unix
      systems.  Moreover the first of the four lines above would suffice, according
      to the comment.  If the other three lines are removed then I have verfied that
      both Tcl and Tk build correctly on the Macintosh.  With those three lines
      gone, the various references to NO_VALUES_H in the configuration code could
      also be removed.  There is exactly one place where NO_VALUES_H is used in a
      header file and that place would have been removed.
      
      While it would be possible to fix the Tk build by defining NO_VALUES_H in,
      say, TkMacOSXPrivate.h it seems cleaner to just get rid of all references
      to values.h since it is obsolete for unix and missing on macOS.
      
      - Marc Culler
      
    5. foundin initialized to: "8.7"
    6. is_private initialized to: "0"
    7. login: "anonymous"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "4a267845b96d18ced148980dad8c23b791785018"
    10. resolution initialized to: "None"
    11. severity initialized to: "Critical"
    12. status initialized to: "Open"
    13. submitter initialized to: "anonymous"
    14. subsystem initialized to: "53. Configuration and Build Tools"
    15. title initialized to: "Use of values.h breaks build of Tk trunk on macOS"
    16. type initialized to: "Bug"
  2. Ticket change [0740e7ecc9] (rid 158635) by fvogel on 2017-11-18 14:47:00:

    1. comment changed to:
      After check-in [49ecc78c8b] tclUnixPort.h contains the following
      
      #include <float.h>
      #ifndef NO_VALUES_H
      #   include <values.h>
      #endif
      
      The Macintosh does not have values.h.  Somehow this is detected by the Tcl
      configure script, causing -DNO_VALUES_H to be added to CFLAGS.  With this, the
      core-8-branch of Tcl builds correctly.  However, the trunk branch of Tk now
      fails to build.
      
      There are two parts to this failure.
      
      1) The Mac port of Tk uses the unix/configure script which either does
      not check for values.h or perhaps was built on a unix system that does have
      values.h.  (There is no autoconf in the XCode toolchain.) In any case,
      -DNO_VALUES_H does not get added to the CFLAGS when building Tk.
      
      2) Because TkMacOSXNotify.c needs to use a stub function defined in
      TclMacOSXNotify.c, it includes tclInt.h which in turn includes tclUnixPort.h.
      Because of the code above, this include fails since NO_VALUES_H is not
      defined and values.h does not exist.
      
      When I look at values.h on my linux system I find this comment:
      
      /* This interface is obsolete.  New programs should use
         <limits.h> and/or <float.h> instead of <values.h>.  */
      
      So it would seem to me that, in addition to getting rid of compat/float.h
      Tcl should get rid of all references to values.h.  There is no issue with
      limits.h.  Both Tcl and Tk include limits.h on the macintosh and on unix
      systems.  Moreover the first of the four lines above would suffice, according
      to the comment.  If the other three lines are removed then I have verfied that
      both Tcl and Tk build correctly on the Macintosh.  With those three lines
      gone, the various references to NO_VALUES_H in the configuration code could
      also be removed.  There is exactly one place where NO_VALUES_H is used in a
      header file and that place would have been removed.
      
      While it would be possible to fix the Tk build by defining NO_VALUES_H in,
      say, TkMacOSXPrivate.h it seems cleaner to just get rid of all references
      to values.h since it is obsolete for unix and missing on macOS.
      
      - Marc Culler
      
    2. icomment:
      I think the commit that changed the behaviour is [bf8e546c42d6973c] (removal of float.h)
      
    3. login: "fvogel"
    4. mimetype: "text/x-fossil-wiki"
  3. Ticket change [91770c0f0b] (rid 158682) by jan.nijtmans on 2017-11-20 09:01:27:

    1. assignee changed to: "jan.nijtmans"
    2. icomment:
      Fully agreed with Marc's analysis. Fixed now on core-8-branch and trunk.
      
      Thanks for the report!
      
    3. login: "jan.nijtmans"
    4. mimetype: "text/plain"
  4. Ticket change [6a139710af] (rid 158683) by jan.nijtmans on 2017-11-20 09:01:39:

    1. closedate changed to: "2458077.87615222"
    2. closer changed to: "jan.nijtmans"
    3. login: "jan.nijtmans"
    4. mimetype: "text/plain"
    5. resolution changed to: "Fixed"
    6. status changed to: "Closed"