LVM2/daemons/clvmd clvmd.c
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2010-10-26 09:57:03
Modified files:
daemons/clvmd : clvmd.c
Log message:
Hotfix usage of __builtin_unreachable()
It's quite new feature which is not supported by older compilers. So until some better macros are introduced into LVM code - hotfix current compilation problems and compile this code only for __clang__ defining compilers.
daemons/clvmd/clvmd.c +4 -0
@@ -491,7 +491,9 @@DEBUGLOG ("Can't initialise cluster interface\n" );log_error ("Can't initialise cluster interface\n" );child_init_signal (DFAIL_CLUSTER_IF ); +#ifdef __clang____builtin_unreachable (); +#endif }DEBUGLOG ("Cluster ready, doing some more initialisation\n" );
@@ -508,7 +510,9 @@ newfd =malloc (sizeof (struct local_client ));if (!newfd) {child_init_signal (DFAIL_MALLOC ); +#ifdef __clang____builtin_unreachable (); +#endif } newfd->fd = local_sock;
daemons/clvmd/clvmd.c line 496
Quoted 3 lines · zkabelac at sourceware.org
daemons/clvmd/clvmd.c +2
-0+#ifdef __clang____builtin_unreachable (); +#endif
Please do not scatter #ifdefs like that through the code.
If the standard /* NOTREACHED */ really doesn't work, then hide the ifdef in a header file and use a #define to make it available precisely where the compiler supports it, defining it to something empty elsewhere.
Alasdair
Dne 26.10.2010 12:46, Alasdair G Kergon napsal(a):
Quoted 10 lines · zkabelac at sourceware.org
daemons/clvmd/clvmd.c line 496
Quoted 3 lines
daemons/clvmd/clvmd.c +2
-0+#ifdef __clang____builtin_unreachable (); +#endif Please do not scatter #ifdefs like that through the code.
If the standard /* NOTREACHED */ really doesn't work, then hide the ifdef in a header file and use a #define to make it available precisely where the compiler supports it, defining it to something empty elsewhere.
Yes - This patch only provides quick compilation hotfix - and I'll prepare better solution later.
Zdenek
Quoted 1 line · zkabelac at sourceware.org
Hotfix usage of
__builtin_unreachable()
Changing this for the current release: removing the ugly ifdef and using an __attribute__((noreturn)) function instead.
Alasdair