During tries to compile tendra under amd64, found: # Compiling building/posix.api/wait.c /var/tmp/paludis/dev-lang-tendra-5.0_pre20070510-r2/work/trunk/bootstrap/src/tools/tcc/tcc -yTENDRA_BASEDIR="/var/tmp/paludis/dev-lang-tendra-5.0_pre20070510-r2/work/trunk/bootstrap/src" -Y/var/tmp/paludis/dev-lang-tendra-5.0_pre20070510-r2/work/trunk/bootstrap/src/lib/env/build -Y64bit -I/var/tmp/paludis/dev-lang-tendra-5.0_pre20070510-r2/work/trunk/src/lib/apis/posix/../../../../src/lib/machines/linux/amd64/include -I/usr/include -f/var/tmp/paludis/dev-lang-tendra-5.0_pre20070510-r2/work/trunk/src/lib/machines/linux/amd64/startup/posix.h -o building/posix.api/wait.j building/posix.api/wait.c -Ymakelib -D__BUILDING_LIBS "/usr/include/bits/resource.h", line 171: Error: [Syntax]: Extra comma at end of list. *** Error code 1 In /usr/include/bits/resource.h: enum __rusage_who { /* The calling process. */ RUSAGE_SELF = 0, #define RUSAGE_SELF RUSAGE_SELF /* All of its terminated child processes. */ RUSAGE_CHILDREN = -1, #define RUSAGE_CHILDREN RUSAGE_CHILDREN #ifdef __USE_GNU /* The calling thread. */ RUSAGE_THREAD = 1 # define RUSAGE_THREAD RUSAGE_THREAD /* Name for the same functionality on Solaris. */ # define RUSAGE_LWP RUSAGE_THREAD #endif }; // <-- line 171 this produces: enum __rusage_who { RUSAGE_SELF = 0, RUSAGE_CHILDREN = -1, }; when no __USE_GNU defined. that comma doesn't compatible with ISO/IEC 14882:1998(E), section "7.2 Enumeration declarations", as I can see. Also about anonymous union/struct (like in bits/pthreadtypes.h for pthread_mutex_t). I don't sure it is allowed in C standard. If it doesn't than glibc should be made more compatible with other C compilers which is more strict about standards. I have also problem: # Compiling building/ansi.api/fail.c /var/tmp/paludis/dev-lang-tendra-5.0_pre20070510-r2/work/trunk/bootstrap/src/tools/tcc/tcc -yTENDRA_BASEDIR="/var/tmp/paludis/dev-lang-tendra-5.0_pre20070510-r2/work/trunk/bootstrap/src" -Y/var/tmp/paludis/dev-lang-tendra-5.0_pre20070510-r2/work/trunk/bootstrap/src/lib/env/build -Y64bit -I/var/tmp/paludis/dev-lang-tendra-5.0_pre20070510-r2/work/trunk/src/lib/apis/ansi/../../../../src/lib/machines/linux/amd64/include -I/usr/include -f/var/tmp/paludis/dev-lang-tendra-5.0_pre20070510-r2/work/trunk/src/lib/machines/linux/amd64/startup/ansi.h -o building/ansi.api/fail.j building/ansi.api/fail.c -Ymakelib -D__BUILDING_LIBS "/usr/include/bits/pthreadtypes.h", line 99: Error: [ISO 6.5.2.1]: Anonymous unions are not allowed. *** Error code 1 Where source: #if __WORDSIZE == 64 int __spins; __pthread_list_t __list; # define __PTHREAD_MUTEX_HAVE_PREV 1 #else unsigned int __nusers; __extension__ union { int __spins; __pthread_slist_t __list; }; // <-- line 99 #endif Reproducible: Always
Thanks for the report. > this produces: enum __rusage_who { RUSAGE_SELF = 0, RUSAGE_CHILDREN = -1, }; > when no __USE_GNU defined. that comma doesn't compatible with ISO/IEC > 14882:1998(E), section "7.2 Enumeration declarations", as I can see. ISO/IEC 14882:1998 describes C++. tendra follows 9899:1990 (C90), which doesn't allow this either, but intends so some day follow 9899:1999 (C99) which does. I'll see if this is also a problem on x86, and if so, make sure tendra accepts the trailing comma. > Also about anonymous union/struct (like in bits/pthreadtypes.h for > pthread_mutex_t). I don't sure it is allowed in C standard. This is not allowed in C, but accepted by tendra provided the environment file says to allow this. You won't have this problem on x86, and you won't have this problem on amd64 if you make the same changes to amd64 as I have to x86. Please see tendra-patches/tendra-linux.patch, in particular the changes to src/lib/machines/linux/80x86/startup/{ansi,system}.h. > If it doesn't than > glibc should be made more compatible with other C compilers which is more > strict about standards. In a perfect world, yes, but I don't think it's possible to change this union without breaking compatibility, and glibc upstream tends to be less than enthusiastic about patches in general... Feel free to contact them, but don't expect anything out of it. :)
This is fixed for x86 in -r2. tendra already had an option to accept the trailing comma, so all that was needed was adding it to the linux/80x86 configuration.