search for: __builtin_types_compatible_p

Displaying 4 results from an estimated 4 matches for "__builtin_types_compatible_p".

2023 Feb 22
1
[libnbd PATCH v3 05/29] vector: (mostly) factor out DEFINE_VECTOR_EMPTY
...e a pointer :) > > > You might ignore this for a first draft, but it is apparently possible > to statically detect this (at least, if using GCC/clang): > > https://stackoverflow.com/questions/19255148/check-if-a-macro-argument-is-a-pointer-or-not Right, we already use at least __builtin_types_compatible_p in TYPE_IS_ARRAY(); that's what I wouldn't want more of, at least via this series. Laszlo
2008 Jan 23
2
PATCH: compile dovecot-1.1.beta14 with gcc 2.95
Hi, I patched dovecot-1.1.beta14 to compile under gcc 2.95. __builtin_expect and __attribute__((malloc)) are only available since gcc 3.0, and __builtin_types_compatible_p since 3.1. Also the flexible array members (char a[]) are not available for gcc 2.95. So I replaced them with zero-extent arrays (char a[0]), which should also work, but that is gcc specific. A general pointer (char* a) should work as well, I guess. I have attached a patch that fixes all this. It...
2023 Apr 10
1
[PATCH] tools/virtio: fix build caused by virtio_ring changes
...irtio/linux/compiler.h index 2c51bccb97bb..ac27b3ea6e67 100644 --- a/tools/virtio/linux/compiler.h +++ b/tools/virtio/linux/compiler.h @@ -8,4 +8,7 @@ #define READ_ONCE(var) (*((volatile typeof(var) *)(&(var)))) #define __aligned(x) __attribute((__aligned__(x))) + +#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) + #endif diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h index 8b877167933d..3cd20cb92649 100644 --- a/tools/virtio/linux/kernel.h +++ b/tools/virtio/linux/kernel.h @@ -10,6 +10,7 @@ #include <stdarg.h> #include <linux/compiler.h> +#incl...
2023 Feb 22
2
[libnbd PATCH v3 05/29] vector: (mostly) factor out DEFINE_VECTOR_EMPTY
On Tue, Feb 21, 2023 at 05:23:52PM +0100, Laszlo Ersek wrote: > On 2/20/23 21:38, Eric Blake wrote: > > On Mon, Feb 20, 2023 at 06:03:13PM +0100, Laszlo Ersek wrote: > >> On 2/15/23 21:27, Eric Blake wrote: > >>> On Wed, Feb 15, 2023 at 03:11:34PM +0100, Laszlo Ersek wrote: > >>>> The "name##_iter" function is used 11 times in libnbd; in all