[CRIU] [PATCH 17/23] parasite.c: rm unneeded init

Kir Kolyshkin kir at openvz.org
Tue Oct 11 18:46:55 PDT 2016


This "struct ctl_msg" initialization is not really needed, as it is
initalized right away in __parasite_daemon_wait_msg() function.

The real reason of removing this init is when compiled by clang
with -O0 etc (i.e. compiler flags set when GCOV=1 env var is present),
clang inserts a call to memset to initialize the structure. This,
of course, leads to "compel piegen" complaining:

	Unexpected undefined symbol: `memset'. External symbol in PIE?

One way of solving it would be to provide a memset() which will call
builtin_memset(), or a simple C implemenation. But as this is the only
place that triggers such a call to memset(), and this initialization
is not really needed, it's easier just to remove it.

Now, there might be more cases like this in the future, but for now
we are good.

Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 criu/pie/parasite.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/criu/pie/parasite.c b/criu/pie/parasite.c
index 11f4cbf..62d4b7b 100644
--- a/criu/pie/parasite.c
+++ b/criu/pie/parasite.c
@@ -635,7 +635,7 @@ static int fini(void)
 
 static noinline __used int noinline parasite_daemon(void *args)
 {
-	struct ctl_msg m = { };
+	struct ctl_msg m;
 	int ret = -1;
 
 	pr_debug("Running daemon thread leader\n");
-- 
2.7.4



More information about the CRIU mailing list