Overview
| Artifact ID: | b561bd194233a966d66ba4592f729f4088fefc1d845b8a69825656997c0edcc1 |
|---|---|
| Ticket: | e058307eef73cf21cf6805ad7c778e1024f9eb7d
Use of values.h breaks build of Tk trunk on macOS |
| User & Date: | anonymous on 2017-11-17 21:19:51 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- 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
- foundin changed to: "8.7"
- is_private changed to: "0"
- login: "anonymous"
- priority changed to: "5 Medium"
- private_contact changed to: "4a267845b96d18ced148980dad8c23b791785018"
- resolution changed to: "None"
- severity changed to: "Critical"
- status changed to: "Open"
- submitter changed to: "anonymous"
- subsystem changed to: "53. Configuration and Build Tools"
- title changed to: "Use of values.h breaks build of Tk trunk on macOS"
- type changed to: "Bug"