humblelogging icon indicating copy to clipboard operation
humblelogging copied to clipboard

Warning when compiled on Mac OS Version 10.12

Open sandboxgod opened this issue 5 years ago • 0 comments

When executing the make command the following warning is generated on macOS:

/Users/richardosborne/Projects/humblelogging/src/util/processinfo.cpp:28:9: warning: 'syscall' is deprecated: first deprecated in macOS 10.12 - syscall(2) is unsupported; please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost().
      [-Wdeprecated-declarations]
        return syscall(SYS_gettid); //return gettid();
               ^
/usr/include/unistd.h:745:6: note: 'syscall' has been explicitly marked deprecated here
int      syscall(int, ...);
         ^
1 warning generated.

The fix is something similar to this: https://github.com/PowerShell/PowerShell/pull/2675/commits/4092948a0a9516bbbdf7ae8415a88874ce0f08c6

Problem is, on macOS, a 64 bit integer is returned. So I suggest reworking this function to return size_t (similar to what spdlog library does here).

sandboxgod avatar Oct 23 '18 23:10 sandboxgod