https://bugs.kde.org/show_bug.cgi?id=519604

--- Comment #5 from Mark Harris <[email protected]> ---
Unfortunately, commit 9c57ad91190878a97204560aff4ee27b64974275 (Darwin: make
sure that VKI_AT_FDCWD is defined on old systems) does not have any effect; on
OS X 10.9 the following error is still present:

m_syswrap/syswrap-generic.c:1813:18: error: use of undeclared identifier
'AT_FDCWD'
      if ((fd != VKI_AT_FDCWD) && !ML_(fd_allowed)(fd, function_name, tid,
False))
                 ^
../include/vki/vki-darwin.h:381:22: note: expanded from macro 'VKI_AT_FDCWD'
#define VKI_AT_FDCWD AT_FDCWD
                     ^

The above commit adds the following to include/vki/vki-darwin.h:

+/* OSX 10.6 was the first to get any *at functions like openat
+ * but it wasn't until OSX 10.10 that a definition for AT_FDCWD
+ * was added. We dont claim to support anything older than 10.8
+ * any more, so no need to worry about versions older than that. */
+#if DARWIN_VERS >= DARWIN_10_10
 #define VKI_AT_FDCWD AT_FDCWD
+#else
+#define VKI_AT_FDCWD -2
+#endif

However, DARWIN_VERS and DARWIN_10_10 are both undefined and therefore evaluate
to 0, making the condition always true.  That is because they are defined in
config.h, which is included after vki-darwin.h.  DARWIN_VERS is used in several
other places in this file, but in those places it seems to just be used to not
define things that are unused on older systems, and so if the condition is
always true it doesn't have any actual impact.  Building with CFLAGS=-Wundef
reveals several warnings like this:

../include/vki/vki-darwin.h:380:5: warning: 'DARWIN_VERS' is not defined,
evaluates to 0 [-Wundef]
#if DARWIN_VERS >= DARWIN_10_10
    ^
../include/vki/vki-darwin.h:380:20: warning: 'DARWIN_10_10' is not defined,
evaluates to 0 [-Wundef]
#if DARWIN_VERS >= DARWIN_10_10
                   ^
../include/vki/vki-darwin.h:396:5: warning: 'DARWIN_VERS' is not defined,
evaluates to 0 [-Wundef]
#if DARWIN_VERS >= DARWIN_10_10
    ^
../include/vki/vki-darwin.h:396:20: warning: 'DARWIN_10_10' is not defined,
evaluates to 0 [-Wundef]
#if DARWIN_VERS >= DARWIN_10_10
                   ^
../include/vki/vki-darwin.h:411:5: warning: 'DARWIN_VERS' is not defined,
evaluates to 0 [-Wundef]
#if DARWIN_VERS >= DARWIN_10_9
    ^
../include/vki/vki-darwin.h:411:20: warning: 'DARWIN_10_9' is not defined,
evaluates to 0 [-Wundef]
#if DARWIN_VERS >= DARWIN_10_9
                   ^
and many more

For the AT_FDCWD issue, I suggest "#ifdef AT_FDCWD" instead of "#if DARWIN_VERS
>= DARWIN_10_10".

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to