folly icon indicating copy to clipboard operation
folly copied to clipboard

Exception specification in declaration does not match previous declaration

Open aqjune opened this issue 6 years ago • 9 comments

When I compile folly (commit 689ef9, Nov 17 2018) with Clang 6.0.0 on Ubuntu 16.04, I get this error:

$ make
Scanning dependencies of target folly_base
[  0%] Building CXX object CMakeFiles/folly_base.dir/folly/IPAddressV6.cpp.o
In file included from /mnt/freezedisk/conmemssa/folly/folly/IPAddressV6.cpp:17:
In file included from /mnt/freezedisk/conmemssa/folly/folly/IPAddressV6.h:28:
In file included from /mnt/freezedisk/conmemssa/folly/folly/FBString.h:61:
In file included from /mnt/freezedisk/conmemssa/folly/folly/memory/Malloc.h:100:
/usr/include/malloc.h:59:14: error: exception specification in declaration does not match previous declaration
extern void *memalign (size_t __alignment, size_t __size)
             ^
/usr/include/jemalloc/jemalloc.h:167:24: note: previous declaration is here
JEMALLOC_EXPORT void *  je_memalign(size_t alignment, size_t size)
                        ^
/usr/include/jemalloc/jemalloc.h:57:23: note: expanded from macro 'je_memalign'
#  define je_memalign memalign
                      ^

cmake was done with CMAKE_CXX_COMPILER and DCMAKE_C_COMPILER parameters set as clang++/clang but no other additional options set.

aqjune avatar Nov 28 '18 17:11 aqjune

how did you solve it , dude, i come to the same problem.

tongzhipeng avatar Jan 18 '19 15:01 tongzhipeng

Well, I couldn't solve the problem :/

2019년 1월 18일 (금) 오후 4:06에 Tony Tong [email protected]님이 작성:

how did you solve it , dude, i come to the same problem.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/facebook/folly/issues/976#issuecomment-455576771, or mute the thread https://github.com/notifications/unsubscribe-auth/AGLzmXxx5MF1bum1aMHLILi7kaUO6XR4ks5vEeMQgaJpZM4Y4C6E .

aqjune avatar Jan 19 '19 09:01 aqjune

Well, I couldn't solve the problem :/ 2019년 1월 18일 (금) 오후 4:06에 Tony Tong [email protected]님이 작성: how did you solve it , dude, i come to the same problem. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#976 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AGLzmXxx5MF1bum1aMHLILi7kaUO6XR4ks5vEeMQgaJpZM4Y4C6E .

OK thank you for the reply, I switch to gcc to compile the project, that's what i can only do for now.

tongzhipeng avatar Jan 21 '19 02:01 tongzhipeng

I think there is a workaround by setting FOLLY_USE_JEMALLOC=0 here: https://github.com/facebook/folly/blob/master/CMake/folly-config.h.cmake#L38

akshayknarayan avatar May 15 '19 17:05 akshayknarayan

Also seeing this with clang 8 on ubuntu 16.04.

xgdgsc avatar May 31 '19 05:05 xgdgsc

using gcc instead solve this problem

xinnjie avatar Aug 12 '19 05:08 xinnjie

build with clang is broken

blockspacer avatar Oct 03 '19 14:10 blockspacer

jemalloc 5.x is required

maxirmx avatar Dec 22 '21 20:12 maxirmx