On Sun, 8 Oct 2017, Andreas Schwab wrote: > On Okt 08 2017, Eric Botcazou <ebotca...@adacore.com> wrote: > > > * builtins.def (BUILT_IN_SETJMP): Declare as library builtin instead > > of GCC builtin if DONT_USE_BUILTIN_SETJMP is defined. > > This breaks gcc.dg/plugin/must-tail-call-2.c, gcc.dg/torture/pr81083.c > and gcc.dg/torture/pr82264.c: > > warning: conflicting types for built-in function 'setjmp' > [-Wbuiltin-declaration-mismatch]
It also breaks the glibc testsuite for AArch64 and IA64 (setjmp/check-installed-headers-cxx). https://sourceware.org/ml/libc-testresults/2017-q4/msg00057.html In file included from ../include/setjmp.h:2:0, from /tmp/cih_test_epu39R.cc:8: ../setjmp/setjmp.h:49:12: error: declaration of 'int setjmp(__jmp_buf_tag*)' conflicts with built-in declaration 'int setjmp(void*)' [-Werror=builtin-declaration-mismatch] extern int setjmp (jmp_buf __env) __THROWNL; ^~~~~~ cc1plus: all warnings being treated as errors That is, the C++ front end does not consider this built-in declaration compatible with <setjmp.h>'s declaration of setjmp (GCC of course does not know the exact type of jmp_buf in libc, so can't know the exact argument type for the library function, so when you use DEF_LIB_BUILTIN instead of DEF_GCC_BUILTIN you get this conflict; the C front end is apparently more lenient about this particular built-in type conflict). -- Joseph S. Myers jos...@codesourcery.com