[DTrace-devel] [PATCH] Initialize variable explicitly

eugene.loh at oracle.com eugene.loh at oracle.com
Mon Apr 25 20:42:50 UTC 2022


From: Eugene Loh <eugene.loh at oracle.com>

Compilation can otherwise complain with
"‘dp’ may be used uninitialized in this function [-Wmaybe-uninitialized]".
It is easy to eliminate such a sensitivity to compiler.

Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
---
 libdtrace/dt_cc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libdtrace/dt_cc.c b/libdtrace/dt_cc.c
index de8bef9d..84cd5a9e 100644
--- a/libdtrace/dt_cc.c
+++ b/libdtrace/dt_cc.c
@@ -2084,7 +2084,7 @@ dt_construct(dtrace_hdl_t *dtp, dt_probe_t *prp, uint_t cflags, dt_ident_t *idp)
 {
 	dt_pcb_t	pcb;
 	dt_node_t	*tnp;
-	dtrace_difo_t	*dp;
+	dtrace_difo_t	*dp = NULL;
 	int		err;
 
 	if ((cflags & ~DTRACE_C_MASK) != 0) {
-- 
2.18.4




More information about the DTrace-devel mailing list