diff mbox series

cli_classic: initialize time_start to avoid clang warning

Message ID 20260307130731.300115-1-bhargav.rathod1905@gmail.com
State New
Headers show
Series cli_classic: initialize time_start to avoid clang warning | expand

Commit Message

Bhargav Rathod March 7, 2026, 1:06 p.m. UTC
Recent clang versions enable -Wsometimes-uninitialized under -Wall.
Since flashrom builds with -Werror, this causes the build to fail.

Initialize time_start to avoid potential use before assignment.

Change-Id: Id695ab35dab9e9ead0c8b04c0e579422f6e10244
Signed-off-by: Bhargav Rathod <bhargav.rathod1905@gmail.com>
---
 cli_classic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Anastasia Klimchuk March 31, 2026, 10:55 a.m. UTC | #1
Hello Bhargav,

Thanks for the message!
This has been fixed and merged recently in the patch:
https://review.coreboot.org/c/flashrom/+/91492
You can update your local repo to get the fix in.

Another thing is that we don't process patches via the mailing list.
If in future you would like to send a contribution, you are welcome,
please read the development guidelines which explains how to do it:
https://flashrom.org/dev_guide/development_guide.html

On Tue, Mar 31, 2026 at 7:52 AM Bhargav Rathod
<bhargav.rathod1905@gmail.com> wrote:
>
> Recent clang versions enable -Wsometimes-uninitialized under -Wall.
> Since flashrom builds with -Werror, this causes the build to fail.
>
> Initialize time_start to avoid potential use before assignment.
>
> Change-Id: Id695ab35dab9e9ead0c8b04c0e579422f6e10244
> Signed-off-by: Bhargav Rathod <bhargav.rathod1905@gmail.com>
> ---
>  cli_classic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cli_classic.c b/cli_classic.c
> index 29f21cca..06cc4e18 100644
> --- a/cli_classic.c
> +++ b/cli_classic.c
> @@ -1055,7 +1055,7 @@ int main(int argc, char *argv[])
>         int ret = 0;
>         int all_matched_count = 0;
>         const char **all_matched_names = NULL;
> -       time_t time_start, time_end;
> +       time_t time_start = 0, time_end = 0;
>
>         struct flashctx *context = NULL; /* holds the active detected chip and other info */
>         ret = flashrom_create_context(&context);
> --
> 2.43.0
>
> _______________________________________________
> flashrom mailing list -- flashrom@flashrom.org
> To unsubscribe send an email to flashrom-leave@flashrom.org
diff mbox series

Patch

diff --git a/cli_classic.c b/cli_classic.c
index 29f21cca..06cc4e18 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -1055,7 +1055,7 @@  int main(int argc, char *argv[])
 	int ret = 0;
 	int all_matched_count = 0;
 	const char **all_matched_names = NULL;
-	time_t time_start, time_end;
+	time_t time_start = 0, time_end = 0;
 
 	struct flashctx *context = NULL; /* holds the active detected chip and other info */
 	ret = flashrom_create_context(&context);