improve clang support (22)

2020-08-11 Thread Bruno Haible
clang supports expression statement syntax (a block inside parentheses) like GCC. This patch makes use of it. 2020-08-11 Bruno Haible Use expression statements also on clang. * lib/cdefs.h (__extension__): Don't define to empty on clang. * lib/obstack.h (__extension__)

improve clang support (23)

2020-08-11 Thread Bruno Haible
clang also has the atomic built-ins and the asm support that GCC has. 2020-08-11 Bruno Haible asyncsafe-spin: Use GCC built-ins also on clang. * lib/asyncsafe-spin.c (asyncsafe_spin_init, do_lock, do_unlock): Use the newer GCC built-ins also on clang. diff --git a/lib

Re: improve clang support (20)

2020-08-11 Thread Bruno Haible
Hi Gisle, > Good work on the clang support, but it looks like you have not > tried clang-cl with the Microsoft 'Windows-Kit' headers. I'm using the 'clang' program with the Microsoft 'Windows-Kit' headers. As I wrote in , the 'c

execute, spawn-pipe: Use _spawnvpe, not spawnvpe

2020-08-11 Thread Bruno Haible
> With clang, on native Windows, the function 'chsize' is not present any more. > This matches the deprecation of this spelling by Microsoft > . Similarly for 'spawnvpe'. It's called '_spawnvpe' now. The old name is dep

fcntl: On native Windows, use _setmode, not setmode

2020-08-11 Thread Bruno Haible
> With clang, on native Windows, the function 'chsize' is not present any more. > This matches the deprecation of this spelling by Microsoft > . Similarly for the 'setmode' function:

improve clang support (24)

2020-08-11 Thread Bruno Haible
clang also has the "flexible array" in struct extension, even on Windows. (ac_cv_c_flexmember=yes.) 2020-08-11 Bruno Haible Use flexible array syntax also on clang. * lib/cdefs.h (__flexarr, __glibc_c99_flexarr_available): For clang, define like for GCC 3. diff --git

improve clang support (25)

2020-08-11 Thread Bruno Haible
Where does clang support the 'restrict' and '__restrict' keywords? It's like with GCC >= 3.1: C mode C++ mode T*__restrict supported supported [__restrict] supported error T*restrict supported error [restrict] supported er

Re: new module 'thread-optim'

2020-08-11 Thread Bruno Haible
There was also another blunder in the same file: IF_MT_DECL produces a warning: $ gcc -O2 -S -Wall foo.c foo.c: In function ‘foo’: foo.c:2:3: warning: statement with no effect [-Wunused-value] (void *)0; ^ $ clang -O2 -S -Wall foo.c foo.c:2:3: warning: expression result unused; should this

Re: new module 'thread-optim'

2020-08-11 Thread Paul Eggert
On 8/9/20 2:44 AM, Bruno Haible wrote: To me, this variable '__libc_single_threaded' is not something that should be visible in source code - because it is so low-level, - because only one platform has it. True enough, but how about suggesting that people write something like the followi