From bf6078d2aaee8b240b7425b9788d8038cd45c8f3 Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Thu, 26 Jun 2025 11:25:20 +0200 Subject: [PATCH] fortran: Avoid freeing uninitialized value When compiling fortran/match.cc, clang emits a warning fortran/match.cc:5301:7: warning: variable 'p' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] which looks accurate, so this patch adds an initialization of p to avoid the use. gcc/fortran/ChangeLog: 2025-06-23 Martin Jambor * match.cc (gfc_match_nullify): Initialize p to NULL; --- gcc/fortran/match.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/fortran/match.cc b/gcc/fortran/match.cc index aa0b04afd56..8355a390ee0 100644 --- a/gcc/fortran/match.cc +++ b/gcc/fortran/match.cc @@ -5293,7 +5293,7 @@ match gfc_match_nullify (void) { gfc_code *tail; - gfc_expr *e, *p; + gfc_expr *e, *p = NULL; match m; tail = NULL; -- 2.47.2