clang is only happy with 'static', not with ={0}
authorChristian Grothoff <christian@grothoff.org>
Fri, 12 Apr 2019 07:38:02 +0000 (09:38 +0200)
committerChristian Grothoff <christian@grothoff.org>
Fri, 12 Apr 2019 07:38:02 +0000 (09:38 +0200)
src/include/gnunet_common.h
src/util/service.c

index 2c11ae15f342dcb4cf7649ae8a414d6f383764d4..94ecd06f83f3e1f62a8a4d376096a8f7560e0171 100644 (file)
@@ -933,8 +933,8 @@ GNUNET_ntoh_double (double d);
  *          entire memory being zero'ed out.
  */
 #define GNUNET_is_zero(a) ({ \
-  const typeof(*a) _z = { 0 };      \
-  memcmp(a, \
+  static const typeof(*a) _z;      \
+  memcmp((a), \
          &_z, \
          sizeof (_z)); })
 
index 3fe9b588373e6c44a2d4bb29ac27293242e628c1..4fd16f93d8386b1624f80e763167c8b1c642ee9b 100644 (file)
@@ -478,7 +478,7 @@ check_ipv6_listed (const struct GNUNET_STRINGS_IPv6NetworkPolicy *list,
     return GNUNET_NO;
   i = 0;
 NEXT:
-  while (0 != (GNUNET_is_zero (&list[i].network)))
+  while (0 != GNUNET_is_zero (&list[i].network))
   {
     for (j = 0; j < sizeof (struct in6_addr) / sizeof (int); j++)
       if (((((int *) ip)[j] & ((int *) &list[i].netmask)[j])) !=