Workaround for a bug in clang version 3.8.0-2ubuntu3 (Ubuntu 16.04). Clang
throws an error 'variable t1 is uninitialized' on line 420  even though
't1' is always initialized before the line.

The original code works on clang version 3.4-1ubuntu3 (Ubuntu 14.04) and on
gcc.

This fixes bug: https://bugs.linaro.org/show_bug.cgi?id=2387

Signed-off-by: Matias Elo <[email protected]>
---
 platform/linux-generic/odp_schedule_sp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/platform/linux-generic/odp_schedule_sp.c 
b/platform/linux-generic/odp_schedule_sp.c
index 8c45123..8314640 100644
--- a/platform/linux-generic/odp_schedule_sp.c
+++ b/platform/linux-generic/odp_schedule_sp.c
@@ -385,7 +385,10 @@ static int schedule_multi(odp_queue_t *from, uint64_t wait,
                uint32_t qi;
                int num;
                odp_time_t t1;
-
+#ifdef __clang__
+               /* Dummy initialization due to a clang bug */
+               t1 = ODP_TIME_NULL;
+#endif
                cmd = sched_cmd(NUM_PRIO);
 
                if (cmd && cmd->s.type == CMD_PKTIO) {
-- 
1.9.1

_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to