apple / foundationdb

FoundationDB - the open source, distributed, transactional key-value store
https://apple.github.io/foundationdb/
Apache License 2.0
14.37k stars 1.3k forks source link

ambiguating new declaration of ‘uint64_t gettid #2545

Open Meai opened 4 years ago

Meai commented 4 years ago

gcc 9.2.1 Linux 5.4.10 commit 16c32c3

[ 2%] Building CXX object flow/CMakeFiles/flow.dir/Profiler.actor.g.cpp.o /home/pc/workarea/test/foundationdb/flow/Profiler.actor.cpp:39:17: error: ambiguating new declaration of ‘uint64_t gettid()’ 39 | static uint64_t gettid() { return syscall(NR_gettid); } | ^~ In file included from /usr/include/unistd.h:1170, from /home/pc/workarea/test/foundationdb/flow/Platform.h:49, from /home/pc/workarea/test/foundationdb/flow/flow.h:40, from /home/pc/workarea/test/foundationdb/flow/Profiler.actor.cpp:21: /usr/include/bits/unistd_ext.h:34:16: note: old declaration ‘pid_t gettid()’ 34 | extern __pid_t gettid (void) __THROW; | ^~ make[2]: [flow/CMakeFiles/flow.dir/build.make:326: flow/CMakeFiles/flow.dir/Profiler.actor.g.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:770: flow/CMakeFiles/flow.dir/all] Error 2 make: *** [Makefile:163: all] Error 2

oh and I had to add this as well, there was an error "pthread_once not defined"

TARGET_LINK_LIBRARIES( actor_flamegraph
pthread
)

to contrib/monitoring/CMakeLists.txt

Ma27 commented 4 years ago

@Meai would you mind checking if #2585 works for you? :)

Meai commented 4 years ago

I think that one is gone now but the build has lots of other errors:

from /home/pc/workarea/test/foundationdb/bindings/c/test/mako/mako.c:6: In function ‘strncpy’, inlined from ‘cleanup’ at /home/pc/workarea/test/foundationdb/bindings/c/test/mako/mako.c:146:3: /usr/include/bits/string_fortified.h:106:10: error: ‘builtin_strncpy’ output truncated before terminating nul copying 4 bytes from a string of the same length [-Werror=stringop-truncation] 106 | return _builtinstrncpy_chk (dest, src, len, bos (dest)); | ^~~~~~~~~~~~~~ In function ‘strncpy’, inlined from ‘cleanup’ at /home/pc/workarea/test/foundationdb/bindings/c/test/mako/mako.c:148:3: /usr/include/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ output truncated before terminating nul copying 4 bytes from a string of the same length [-Werror=stringop-truncation] 106 | return builtin_strncpy_chk (dest, src, len, bos (dest)); | ^~~~~~~~~~~~~~ /home/pc/workarea/test/foundationdb/bindings/c/test/mako/mako.c: In function ‘run_one_transaction’: /home/pc/workarea/test/foundationdb/bindings/c/test/mako/mako.c:614:7: error: ‘rc’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 614 | if (rc == FDB_ERROR_ABORT) { | ^ /home/pc/workarea/test/foundationdb/bindings/c/test/mako/mako.c: In function ‘worker_process_main’: /home/pc/workarea/test/foundationdb/bindings/c/test/mako/mako.c:822:14: error: ‘worker_threads’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 822 | pthread_t *worker_threads; | ^~~~~~ /home/pc/workarea/test/foundationdb/bindings/c/test/mako/mako.c:969:6: error: ‘thread_args’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 969 | if (thread_args) | ^ /home/pc/workarea/test/foundationdb/bindings/c/test/mako/mako.c: In function ‘print_stats’: /home/pc/workarea/test/foundationdb/bindings/c/test/mako/mako.c:1445:6: error: ‘print_err’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 1445 | if (print_err) { | ^ /home/pc/workarea/test/foundationdb/bindings/c/test/mako/mako.c: In function ‘main’: /home/pc/workarea/test/foundationdb/bindings/c/test/mako/mako.c:1938:5: error: ‘worker_pids’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 1938 | free(worker_pids); | ^~~~~ /home/pc/workarea/test/foundationdb/bindings/c/test/mako/mako.c:1940:6: error: ‘shm’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 1940 | if (shm != MAP_FAILED) | ^

atn34 commented 4 years ago

CC #2147 , @AlvinMooreSr