Thread (4 messages) 4 messages, 2 authors, 2016-06-15

Re: [PATCH 2/2] Fix sparse warnings

flat view

From: Stephen Boyd <hidden>
Date: 2016-06-15 22:50:49

On 03/21/11 03:10, Johannes Sixt wrote:
Am 3/21/2011 10:45, schrieb Stephen Boyd:
quoted
diff --git a/daemon.c b/daemon.c
index 347fd0c..4c8346d 100644
--- a/daemon.c
+++ b/daemon.c
@@ -660,7 +660,7 @@ static void check_dead_children(void)
 static char **cld_argv;
 static void handle(int incoming, struct sockaddr *addr, socklen_t addrlen)
 {
-	struct child_process cld = { 0 };
+	struct child_process cld = { NULL };
IMO this change is not good.

The purpose of { 0} is not to initialize (only) the first member, but
rather to serve as a visual marker that says "We want the complete struct
zero-initialized".
Sure that's fine. I was iffy on that change, but decided to try to
silence sparse as much as possible. I'm fine with dropping those hunks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help