braces around scalar initializer for type

Alexey Pavlov alexpux@gmail.com
Thu Mar 12 19:47:00 GMT 2015


2015-03-12 22:22 GMT+03:00 Corinna Vinschen:
> Alexey,
>
> On Mar 12 21:18, Alexey Pavlov wrote:
>> Building MSYS2 runtime I'm get:
>>
>> /build2/msys2-runtime/src/msys2-runtime/winsup/cygwin/net.cc:82:56:
>> error: braces around scalar initializer for type 'u_char {aka unsigned
>> char}'
>>  const struct in6_addr in6addr_any = {{IN6ADDR_ANY_INIT}};
>>
>>                           ^
>> /build2/msys2-runtime/src/msys2-runtime/winsup/cygwin/net.cc:83:66:
>> error: braces around scalar initializer for type 'u_char {aka unsigned
>> char}'
>>  const struct in6_addr in6addr_loopback = {{IN6ADDR_LOOPBACK_INIT}};
>>
>>                                                ^
>> /build2/msys2-runtime/src/msys2-runtime/winsup/cygwin/../Makefile.common:43:
>> recipe for target 'net.o' failed
>>
>> So I think next patch can be applied:
>
> I'm ok with that patch, but it's missing the ChangeLog entry,  Please
> provide ChangeLog entries per https://cygwin.com/contrib.html.
>

>From c416f9666f21084ce73d13b479d13308c0fc7340 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Thu, 12 Mar 2015 22:46:01 +0300
Subject: [PATCH] Remove extra braces around single values.

---
 winsup/cygwin/ChangeLog | 4 ++++
 winsup/cygwin/net.cc    | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 1305dfa..96d3de9 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,9 @@
 2015-03-12  Alexey Pavlov  <alexpux@gmail.com>

+ * net.cc: Remove extra braces.
+
+2015-03-12  Alexey Pavlov  <alexpux@gmail.com>
+
  * include/cygwin/version.h: Fix typo.

 2015-03-12  Corinna Vinschen  <corinna@vinschen.de>
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index e06fd52..f9b317c 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -79,8 +79,8 @@ extern "C"
  const unsigned char *);
 } /* End of "C" section */

-const struct in6_addr in6addr_any = {{IN6ADDR_ANY_INIT}};
-const struct in6_addr in6addr_loopback = {{IN6ADDR_LOOPBACK_INIT}};
+const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
+const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT;

 static fhandler_socket *
 get (const int fd)
-- 
2.3.0


>
> Thanks,
> Corinna
>
> --
> Corinna Vinschen                  Please, send mails regarding Cygwin to
> Cygwin Maintainer                 cygwin AT cygwin DOT com
> Red Hat



More information about the Cygwin-patches mailing list