On 8/20/24 9:38 PM, Marc Feeley wrote:
#if __has_attribute(musttail) #define ___PROPER_TAIL_CALL(call) __attribute__((musttail)) return call #else #if defined(___TRUST_C_TCO) #define ___PROPER_TAIL_CALL(call) return call #endif #endif
OK, here's how I understand things. I could be wrong, of course.
GCC 15.0.0 (developmental mainline)
1. __has_attribute(musttail) is true.
2. Does not currently support the __attribute__((musttail)) notation, so if you need to bootstrap mainline Gambit, which first checks out and builds 4.9.5 release before building GitHub head, you can't use current mainline gcc. I'll ask the GCC folks whether __attribute__((musttail)) will be supported.
3. Does support [[gnu::musttail]] and [[clang::musttail]] and they appear to be synonyms.
Clang 14.0.0 (what I have on my Ubuntu 22.04 box):
1. __has_attribute(musttail) is true.
2. Supports the __attribute__((musttail)) notation.
3. If you want to use the [[clang::musttail]] notation, you must set -std=c2x or something similar on the command line.
So by fiddling around with include/gambit.h by hand, I got current Gambit head to build with [[clang:musttail]] on both GCC mainline and clang 14.0.0. make check passes with GCC mainline.
The clang build with -std=c2x has failures in make check of the following form:
------------ TEST 6 (link and execute the code generated) rm -f mix_.c mix.o mix_.o mix ../gsc/gsc -:~~bin=../bin,~~lib=../lib,~~include=../include -f -c mix.scm ../gsc/gsc -:~~bin=../bin,~~lib=../lib,~~include=../include -f -warnings -o mix -exe mix.c In file included from mix.c:631: /home/lucier/programs/gambit/gambit/include/gambit.h:9519:5: error: unknown type name 'sigset_t'; did you mean '__sigset_t'? sigset_t sigset[3]; ^~~~~~~~ __sigset_t /usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h:8:3: note: '__sigset_t' declared here } __sigset_t; ^ 1 error generated. *** ERROR IN ##main -- target compilation or link failed while compiling "mix.c" make[1]: [makefile:149: test6] Error 70 (ignored)
Brad