Overview
| Artifact ID: | ce054a06146c3e603fc0916efaa979a8a393c56cc32b8ee860f5d8e492821bdd |
|---|---|
| Ticket: | dc1db1588e4c6c36f12fb447ec77036cefdbaf18
warnings when building on macOS |
| User & Date: | dkf on 2021-07-03 11:40:53 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/html"
- comment changed to:
In the current <code>core-8-branch</code> there are lots of warnings when building the notifier. The following is from <code>tclKqueueNotfy.c</code>, but equivalent ones are also produced by <code>tclEpollNotfy.c</code>. <pre style="overflow-x:scroll;"> In file included from /Users/dkf/tcl/unix/tclKqueueNotfy.c:1: /Users/dkf/tcl/generic/tclInt.h:5208:52: warning: uninitialized 'const TclUnusedFile_unix_tclKqueueNotfy_c' is invalid in C++ [-Wc++-compat] 5208 | static __attribute__((used)) const void *const TclUnusedFile_ ## name; \ | ^~~~~~~~~~~~~~ /Users/dkf/tcl/unix/tclKqueueNotfy.c:766:1: note: in expansion of macro 'TCL_MAC_EMPTY_FILE' 766 | TCL_MAC_EMPTY_FILE(unix_tclKqueueNotfy_c) | ^~~~~~~~~~~~~~~~~~ /Users/dkf/tcl/generic/tclInt.h:5209:30: warning: duplicate declaration of 'TclUnusedFile_unix_tclKqueueNotfy_c' is invalid in C++ [-Wc++-compat] 5209 | static const void *const TclUnusedFile_ ## name = NULL; | ^~~~~~~~~~~~~~ /Users/dkf/tcl/unix/tclKqueueNotfy.c:766:1: note: in expansion of macro 'TCL_MAC_EMPTY_FILE' 766 | TCL_MAC_EMPTY_FILE(unix_tclKqueueNotfy_c) | ^~~~~~~~~~~~~~~~~~ /Users/dkf/tcl/generic/tclInt.h:5208:52: note: previous declaration of 'TclUnusedFile_unix_tclKqueueNotfy_c' was here 5208 | static __attribute__((used)) const void *const TclUnusedFile_ ## name; \ | ^~~~~~~~~~~~~~ /Users/dkf/tcl/unix/tclKqueueNotfy.c:766:1: note: in expansion of macro 'TCL_MAC_EMPTY_FILE' 766 | TCL_MAC_EMPTY_FILE(unix_tclKqueueNotfy_c) | ^~~~~~~~~~~~~~~~~~ </pre> The problem is that deleting the symbol makes the macOS linker complain about an empty file. My preferred fix is simple: don't use the <code>-Wc++-compat</code> flag as these files simply do not ever need to build as C++. Alternatively, we could find some other way of making a symbol that exists so that file is non-empty but gets elided during linking, but frankly I'd just drop TIP 557 support in these implementation files as it has proved to not be a win (but supporting it for our <em>headers</em> is fine). It's equivalent (in my mind) to how some of Tk's implementation on some platforms is in Objective C, but Tk's API is not. - is_private changed to: "0"
- login: "dkf"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "dkf"
- subsystem changed to: "01. Notifier"
- title changed to: "warnings when building on macOS"
- type changed to: "Bug"